Skip to content

Commit 6bed2db

Browse files
authored
Merge pull request #695 from NLeSC/588-replace-yapf-with-ruff-format
2 parents 3e7e203 + 72ac687 commit 6bed2db

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
### Changed
1010

11+
* Recommend `ruff format` instead of `yapf` for fixing code style readability [#695](https://github.com/NLeSC/python-template/pull/695)
12+
1113
### Removed
1214

1315
## 0.6.1

template/pyproject.toml.jinja

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ ignore = [
135135
"FIX001", # Resolve FIXMEs
136136
"FIX002", # Resolve TODOs
137137
"B028", # No explicit `stacklevel` keyword argument found in warning
138+
"COM812", # Trailing commas are taken care of by `ruff format`
138139
# No docstrings required in the following cases
139140
"D100", # Missing module docstring
140141
"D104", # Missing public package docstring

template/{% if AddDevDoc %}README.dev.md{% endif %}.jinja

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ coverage report
6565
{%- if AddLinting -%}
6666
## Running linters locally
6767

68-
For linting and sorting imports we will use [ruff](https://beta.ruff.rs/docs/). Running the linters requires an
68+
For linting and sorting imports we will use [ruff](https://docs.astral.sh/ruff/). Running the linters requires an
6969
activated virtual environment with the development tools installed.
7070

7171
```shell
@@ -76,7 +76,11 @@ ruff check .
7676
ruff check . --fix
7777
```
7878

79-
To fix readability of your code style you can use [yapf](https://github.com/google/yapf).
79+
It also provides a command to fix readability of your code style:
80+
81+
```shell
82+
ruff format .
83+
```
8084
{%- endif -%}
8185

8286
{%- if AddPreCommit -%}

template/{% if AddPreCommit %}.githooks{% endif %}/pre-commit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ echo "Script $0 triggered ..."
66
echo "Starting ruff analysis..."
77

88
# quietly run ruff
9-
ruff check --fix
10-
ruff format
9+
ruff check --fix .
10+
ruff format .
1111

1212
# use return code to abort commit if necessary
1313
if [ $? != "0" ]; then

template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddGitHubActionBuild %}build.yml{% endif %}.jinja

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ jobs:
6161
python -m pip install .[dev,publishing]
6262
- name: Check style against standards using ruff
6363
run: |
64-
ruff check
65-
ruff format --check
64+
ruff check .
65+
ruff format --check .
6666
{%- endif %}
6767

6868
{%- if AddTyping %}
@@ -82,4 +82,4 @@ jobs:
8282
- name: Run {{ SelectTypeChecker }}
8383
run: |
8484
{{ SelectTypeChecker }}
85-
{%- endif %}
85+
{%- endif %}

0 commit comments

Comments
 (0)