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 a2b6127
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 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"
8 changes: 5 additions & 3 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 Expand Up @@ -82,7 +84,7 @@ jobs:
name: Integration test report
path: ${{ matrix.os }}_integration_test_report.html
typechecking:
name: mypy
name: mypy --install-types
runs-on: ubuntu-latest
steps:
- name: Checkout
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 a2b6127

Please sign in to comment.