Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .Rprofile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,17 @@

message("Sourcing .Rprofile...")

source("renv/activate.R")
# Source renv activation with error handling
tryCatch(
source("renv/activate.R"),
error = function(e) {
warning("Failed to source renv/activate.R: ", e$message)
message("Attempting renv::init() to repair environment...")
if (requireNamespace("renv", quietly = TRUE)) {
renv::restore()
}
}
)

if (system.file(package = "dfeshiny") != "") {
library(dfeshiny)
Expand Down
55 changes: 10 additions & 45 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,52 +5,17 @@ on:
branches: [main, master]
pull_request:

name: lint.yaml
name: lintr

permissions: read-all
permissions:
actions: write
contents: read
packages: write
pull-requests: write
security-events: write

jobs:
lint:
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 git2r dependencies
run: sudo apt-get install -y libgit2-dev

- name: Install proj library (terra depdencies)
run: sudo apt-get install libproj-dev

- name: Install gdal library (terra dependencies)
run: sudo apt-get install libgdal-dev

- name: Install udunits library (units dependencies)
run: sudo apt-get install libudunits2-dev

- name: Cache renv packages
id: cache-renv
uses: actions/cache@v4
with:
path: cache-renv
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
restore-keys: |
${{ runner.os }}-renv-

- uses: r-lib/actions/setup-renv@v2

- name: Restore renv snapshot
shell: Rscript {0}
run: |
if (!requireNamespace("lintr", quietly = TRUE)) install.packages("lintr")

- name: Lint
run: lintr::lint_dir()
shell: Rscript {0}
env:
LINTR_ERROR_ON_LINT: true
uses: dfe-analytical-services/dfeshiny/.github/workflows/lintr_reusable.yaml@main
with:
is_package: "false"
Loading
Loading