Skip to content

Commit

Permalink
Implement some suggestions from repo-review tool
Browse files Browse the repository at this point in the history
- Add concurrency for workflows (so repeated pushes on the same branch cancel previous workflow run)
- Add dependabot for GHA version updating
- Add prettier as formatter (removing Biome as it didn't format the needed files)
- --show-fixes in ruff config

Used https://learn.scientific-python.org/development/guides/repo-review/ to highlight suggested changes in project configuration. Some items (upload-artifact version change, nox/tox integration, spell checker, pytest options) weren't included as they add  maintainence burden beyond their benefits, or hinder development (codespell).
  • Loading branch information
VeckoTheGecko committed Aug 27, 2024
1 parent 5690b76 commit 4dcd89e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ on:
- "master"
- "test-me/*"
pull_request:
branches:
- "*"
schedule:
- cron: "0 7 * * 1" # Run every Monday at 7:00 UTC

concurrency:
group: branch-${{ github.head_ref }}
cancel-in-progress: true

defaults:
run:
shell: bash -el {0}
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ repos:
rev: v0.5.6
hooks:
- id: ruff
args: [ --fix ]
args: [--fix, --show-fixes]
- id: ruff
name: ruff (isort jupyter)
args: [--select, I, --fix]
types_or: [ jupyter ]
types_or: [jupyter]
- id: ruff-format
types_or: [ python, jupyter ]
- repo: https://github.com/biomejs/pre-commit
Expand All @@ -31,9 +31,9 @@ repos:
hooks:
- id: flake8
name: pydoclint
files: 'none'
files: "none"
# files: parcels/fieldset.py # put here instead of in config file due to https://github.com/pre-commit/pre-commit-hooks/issues/112#issuecomment-215613842
args:
- --select=DOC103 # TODO: Expand coverage to other codes
- --select=DOC103 # TODO: Expand coverage to other codes
additional_dependencies:
- pydoclint[flake8]
1 change: 0 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ comment:
require_base: false
require_head: true
hide_project_coverage: true

# When modifying this file, please validate using
# curl -X POST --data-binary @codecov.yml https://codecov.io/validate
1 change: 0 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ dependencies:
- types-tqdm
- types-psutil


# Linting
- pre_commit

Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ local_scheme = "no-local-version"
python_files = ["test_*.py", "example_*.py", "*tutorial*"]

[tool.ruff]
target-version = "py310"
line-length = 120

[tool.ruff.lint]
Expand Down

0 comments on commit 4dcd89e

Please sign in to comment.