Skip to content

Commit 85d5247

Browse files
committed
Merge branch 'main' into 572_project_setup
2 parents c0145c6 + 92e3337 commit 85d5247

6 files changed

Lines changed: 18 additions & 13 deletions

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
### Added
66
* Keep project_setup.md for all the profiles and remove from the menu [#576](https://github.com/NLeSC/python-template/pull/576)
77
* Make contributing guidelines optional [#465](https://github.com/NLeSC/python-template/pull/465)
8+
* Make linting optional [#568](https://github.com/NLeSC/python-template/pull/568)
89
* Make editorconfig optional [#571](https://github.com/NLeSC/python-template/pull/571)
9-
* Make contributing guidelines optional [#465]()
10+
* Make contributing guidelines optional [#465](https://github.com/NLeSC/python-template/pull/465)
1011
* Make developer documentation optional [#467](https://github.com/NLeSC/python-template/pull/541)
1112
* Make Code of Conduct optional [#464](https://github.com/NLeSC/python-template/pull/530)
1213
* New YAML files for copier questions [#529](https://github.com/NLeSC/python-template/pull/529)

copier/questions/features_code_quality.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SelectCodeQualityFeatures:
77
type: yaml
88
default: |-
99
{% if template_profile == 'recommended' %}
10-
[SelectGitHubActions_flag, not_implemented_linting, AddSonarCloud_flag, AddEditorConfig_flag]
10+
[SelectGitHubActions_flag, AddLinting_flag, AddSonarCloud_flag, AddEditorConfig_flag]
1111
{%- else -%}
1212
[]
1313
{%- endif %}
@@ -17,8 +17,8 @@ SelectCodeQualityFeatures:
1717
GitHub Actions:
1818
value: SelectGitHubActions_flag
1919
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
20-
Linting (using ruff NOT_IMPLEMENTED):
21-
value: not_implemented_linting
20+
Linting:
21+
value: AddLinting_flag
2222
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
2323
Pre-commit:
2424
value: AddPreCommit_flag
@@ -60,27 +60,26 @@ AddGitHubActionBuild:
6060
type: bool
6161
default: "{{ 'AddGitHubActionBuild_flag' in SelectGitHubActions }}"
6262
when: false
63-
6463
AddGitHubActionDocumentation:
6564
type: bool
6665
default: "{{ 'AddGitHubActionDocumentation_flag' in SelectGitHubActions }}"
6766
when: false
68-
6967
AddLinkCheck:
7068
type: bool
7169
default: "{{ 'AddLinkCheck_flag' in SelectGitHubActions }}"
7270
when: false
73-
7471
AddPreCommit:
7572
type: bool
7673
default: "{{ 'AddPreCommit_flag' in SelectCodeQualityFeatures }}"
7774
when: false
78-
7975
AddSonarCloud:
8076
type: bool
8177
default: "{{ 'AddSonarCloud_flag' in SelectCodeQualityFeatures }}"
8278
when: false
83-
79+
AddLinting:
80+
type: bool
81+
default: "{{ 'AddLinting_flag' in SelectCodeQualityFeatures }}"
82+
when: false
8483
AddEditorConfig:
8584
type: bool
8685
default: "{{ 'AddEditorConfig_flag' in SelectCodeQualityFeatures }}"

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
- name: Verify that we can build the package
3939
run: python -m build
4040

41+
{%- if AddLinting -%}
4142
lint:
4243
name: Linting build
4344
runs-on: ubuntu-latest
@@ -62,3 +63,4 @@ jobs:
6263
run: |
6364
ruff check
6465
ruff format --check
66+
{%- endif -%}

template/.github/workflows/next_steps.yml renamed to template/.github/workflows/{% if AddLinting %}next_steps_linting.yml{% endif %}

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ on: [push]
22
permissions:
33
contents: write
44
issues: write
5-
name: Create issues for next steps
5+
name: Create issues for linting
66
jobs:
77
next_steps:
88
runs-on: ubuntu-latest
@@ -13,7 +13,7 @@ jobs:
1313
env:
1414
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1515
with:
16-
filename: .github/next_steps/05_linting.md
16+
filename: .github/workflows/next_steps_linting_issue.md
1717
id: linting
1818
- name: List created issues
1919
run: |
@@ -23,7 +23,8 @@ jobs:
2323
run: |
2424
git config --global user.name 'NLeSC Python template'
2525
git config --global user.email 'nlesc-python-template@users.noreply.github.com'
26-
git rm .github/workflows/next_steps.yml
27-
git rm -r .github/next_steps
26+
git pull # other next step workflows may push changes before
27+
git rm .github/workflows/next_steps_linting.yml
28+
git rm .github/workflows/next_steps_linting_issue.md
2829
git commit -am "Cleanup automated next steps issue generator"
2930
git push

template/.github/next_steps/05_linting.md.jinja renamed to template/.github/workflows/{% if AddLinting %}next_steps_linting_issue.md{% endif %}.jinja

File renamed without changes.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ coverage report
6262

6363
`coverage` can also generate output in HTML and other formats; see `coverage help` for more information.
6464

65+
{%- if AddLinting -%}
6566
## Running linters locally
6667

6768
For linting and sorting imports we will use [ruff](https://beta.ruff.rs/docs/). Running the linters requires an
@@ -76,6 +77,7 @@ ruff . --fix
7677
```
7778

7879
To fix readability of your code style you can use [yapf](https://github.com/google/yapf).
80+
{%- endif -%}
7981

8082
{%- if AddPreCommit -%}
8183
You can enable automatic linting with `ruff` on commit by enabling the git hook from `.githooks/pre-commit`, like so:

0 commit comments

Comments
 (0)