From 64663d15ebc127402b1060e4f58b8308491fadd7 Mon Sep 17 00:00:00 2001 From: Jake Herrmann Date: Mon, 16 Dec 2024 17:04:05 -0900 Subject: [PATCH 1/3] ruff updates --- .github/workflows/reusable-ruff.yml | 2 +- CHANGELOG.md | 5 +++++ README.md | 8 ++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/reusable-ruff.yml b/.github/workflows/reusable-ruff.yml index 46e4e52..25b7bd8 100644 --- a/.github/workflows/reusable-ruff.yml +++ b/.github/workflows/reusable-ruff.yml @@ -18,7 +18,7 @@ jobs: python -m pip install ruff - name: Ruff linting check - run: ruff check --select I --output-format=github . || echo 'To automatically fix errors, run `ruff check --select I --fix .`' + run: ruff check --output-format=github . || echo 'To automatically fix errors, run `ruff check --fix .`' - name: Ruff format check run: ruff format --diff . || echo 'To automatically fix errors, run `ruff format .`' diff --git a/CHANGELOG.md b/CHANGELOG.md index cdd01bd..91b8a7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/) and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.13.1] + +### Changed +- Reverts the addition of `--select I` to [`reusable-ruff`](.github/workflows/reusable-ruff.yml), as this option is already included in the recommended `pyproject.toml` settings given in the README. + ## [0.13.0] ### Changed diff --git a/README.md b/README.md index aee63a4..82267cb 100644 --- a/README.md +++ b/README.md @@ -236,6 +236,8 @@ To conform to ASFHyP3's Python style add the following to your project's `pyproj ```toml [tool.ruff] line-length = 120 +# The directories to consider when resolving first- vs. third-party imports. +# See: https://docs.astral.sh/ruff/settings/#src src = ["src", "tests"] [tool.ruff.format] @@ -259,12 +261,6 @@ case-sensitive = true lines-after-imports = 2 ``` -Ruff can automatically fix many linting errors and reformat code to match your Python style by running these commands: -```shell -ruff check --fix . -ruff format . -``` - ### [`reusable-git-object-name.yml`](./.github/workflows/reusable-git-object-name.yml) Outputs the human-readable git object name from [`git describe --dirty --tags --long --match "*[0-9]*"`](https://git-scm.com/docs/git-describe) From 67b65d14b89654915114bd6c7f43ef08bfebb976 Mon Sep 17 00:00:00 2001 From: Jake Herrmann Date: Tue, 17 Dec 2024 11:48:57 -0900 Subject: [PATCH 2/3] update readme for ruff --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 82267cb..7cdba37 100644 --- a/README.md +++ b/README.md @@ -230,9 +230,17 @@ jobs: uses: ASFHyP3/actions/.github/workflows/reusable-ruff.yml@v0.12.0 ``` -to ensure the Python code is styled correctly. +Make sure that `pyproject.toml` contains the appropriate Python version specifier +(see the [ruff docs](https://docs.astral.sh/ruff/settings/#target-version)), e.g: + +``` +[project] +requires-python = ">=3.13" +``` + +To conform to ASFHyP3's Python style add the following to `pyproject.toml` +(and update the `src =` line as needed, for import ordering): -To conform to ASFHyP3's Python style add the following to your project's `pyproject.toml`: ```toml [tool.ruff] line-length = 120 From b13457a43f03fed185f60ec3c7c8593dbd40b8ed Mon Sep 17 00:00:00 2001 From: Jake Herrmann Date: Tue, 17 Dec 2024 11:51:50 -0900 Subject: [PATCH 3/3] code toml --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7cdba37..4b17086 100644 --- a/README.md +++ b/README.md @@ -233,7 +233,7 @@ jobs: Make sure that `pyproject.toml` contains the appropriate Python version specifier (see the [ruff docs](https://docs.astral.sh/ruff/settings/#target-version)), e.g: -``` +```toml [project] requires-python = ">=3.13" ```