Skip to content

Commit

Permalink
Merge pull request #4 from samuelbharti/dev
Browse files Browse the repository at this point in the history
Add Lint workflow
  • Loading branch information
samuelbharti authored Oct 2, 2024
2 parents 2dc919f + 9eaa61a commit 1cb057c
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 26 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
33 changes: 33 additions & 0 deletions .github/workflows/lint-project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: lint-project.yaml

permissions: read-all

jobs:
lint-project:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: Install lintr
run: install.packages("lintr")
shell: Rscript {0}

- name: Lint root directory
run: lintr::lint_dir()
shell: Rscript {0}
env:
LINTR_ERROR_ON_LINT: true
2 changes: 2 additions & 0 deletions .lintr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
linters: linters_with_defaults() # see vignette("lintr")
encoding: "UTF-8"
5 changes: 2 additions & 3 deletions R/load_components.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Load modules
sapply(list.files('modules', full.names = TRUE), function(x) source(x))
sapply(list.files("modules", full.names = TRUE), function(x) source(x))
# Load user interface
sapply(list.files('userInterface', full.names = TRUE), function(x) source(x))

sapply(list.files("userInterface", full.names = TRUE), function(x) source(x))
4 changes: 2 additions & 2 deletions dev/dev.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Use this script to test code blocks for app dev.
# Make sure to add this "dev" directory
# Use this script to test code blocks for app dev.
# Make sure to add this "dev" directory.
# in your gitignore after template initialization.
5 changes: 2 additions & 3 deletions global.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Load libraries/ Source Files
library(shiny)

# Load data/connections

# Preprocess small data

2 changes: 1 addition & 1 deletion server.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Shiny Server
function(input, output, session) {

}
6 changes: 3 additions & 3 deletions ui.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
navbarPage(
'My app',
tabPanel('Home', home_page),
tabPanel('Other', other_page),
"My app",
tabPanel("Home", home_page),
tabPanel("Other", other_page),
)
14 changes: 7 additions & 7 deletions userInterface/home_ui.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
home_page <- fluidPage(
# Page title
titlePanel('Home Page'),
hr(),
fluidRow(
column(6,h2('Column size 3')),
column(6,h2('Column size 3'))
)
# Page title
titlePanel("Home Page"),
hr(),
fluidRow(
column(6, h2("Column size 6")),
column(6, h2("Column size 6"))
)
)
14 changes: 7 additions & 7 deletions userInterface/other_ui.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
other_page <- fluidPage(
# Page title
titlePanel('Other Page'),
hr(),
fluidRow(
column(6,h2('Column size 3')),
column(6,h2('Column size 3'))
)
# Page title
titlePanel("Other Page"),
hr(),
fluidRow(
column(6, h2("Column size 6")),
column(6, h2("Column size 6"))
)
)

0 comments on commit 1cb057c

Please sign in to comment.