From 4dcd89eaf3a464c87dff9491cb9c0ea106bb39f2 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 27 Aug 2024 13:24:16 +0200 Subject: [PATCH] Implement some suggestions from repo-review tool - 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). --- .github/dependabot.yml | 6 ++++++ .github/workflows/ci.yml | 6 ++++-- .pre-commit-config.yaml | 8 ++++---- codecov.yml | 1 - environment.yml | 1 - pyproject.toml | 1 - 6 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..8ac6b8c49 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41b91bfe8..de52b7262 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eeae58c68..15a452cc2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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] diff --git a/codecov.yml b/codecov.yml index 3ba50f502..c136680e5 100644 --- a/codecov.yml +++ b/codecov.yml @@ -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 diff --git a/environment.yml b/environment.yml index d096b3c3a..93906ce11 100644 --- a/environment.yml +++ b/environment.yml @@ -38,7 +38,6 @@ dependencies: - types-tqdm - types-psutil - # Linting - pre_commit diff --git a/pyproject.toml b/pyproject.toml index 11996b56e..134a6f8ff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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]