Skip to content

Commit 2e4803a

Browse files
authored
Refactor nox task names (#275)
1 parent fc2fc48 commit 2e4803a

File tree

23 files changed

+105
-104
lines changed

23 files changed

+105
-104
lines changed

.github/workflows/checks.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
python-version: ${{ matrix.python-version }}
6060

6161
- name: Run lint
62-
run: poetry run nox -s lint
62+
run: poetry run nox -s lint:code
6363

6464
- name: Upload Artifacts
6565
uses: actions/upload-artifact@v4.4.0
@@ -87,7 +87,7 @@ jobs:
8787
python-version: ${{ matrix.python-version }}
8888

8989
- name: Run type-check
90-
run: poetry run nox -s type-check
90+
run: poetry run nox -s lint:typing
9191

9292
Security:
9393
name: Security Checks (Python-${{ matrix.python-version }})
@@ -108,7 +108,7 @@ jobs:
108108
python-version: ${{ matrix.python-version }}
109109

110110
- name: Run security linter
111-
run: poetry run nox -s security
111+
run: poetry run nox -s lint:security
112112

113113
- name: Upload Artifacts
114114
uses: actions/upload-artifact@v4.4.0
@@ -139,7 +139,7 @@ jobs:
139139
python-version: ${{ matrix.python-version }}
140140

141141
- name: Run Tests and Collect Coverage
142-
run: poetry run nox -s coverage -- -- --db-version ${{ matrix.exasol-version }}
142+
run: poetry run nox -s test:coverage -- -- --db-version ${{ matrix.exasol-version }}
143143

144144
- name: Upload Artifacts
145145
uses: actions/upload-artifact@v4.4.0

.github/workflows/report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
cp security-python3.9/.security.json ../
3636
3737
- name: Generate Report
38-
run: poetry run nox -s report -- -- --format json | tee metrics.json
38+
run: poetry run nox -s project:report -- -- --format json | tee metrics.json
3939

4040
- name: Upload Artifacts
4141
uses: actions/upload-artifact@v4.4.0
@@ -46,7 +46,7 @@ jobs:
4646
- name: Generate GitHub Summary
4747
run: |
4848
echo -e "# Summary\n" >> $GITHUB_STEP_SUMMARY
49-
poetry run nox -s report -- -- --format markdown >> $GITHUB_STEP_SUMMARY
49+
poetry run nox -s project:report -- -- --format markdown >> $GITHUB_STEP_SUMMARY
5050
echo -e "\n\n# Coverage\n" >> $GITHUB_STEP_SUMMARY
5151
poetry run coverage report -- --format markdown >> $GITHUB_STEP_SUMMARY
5252
echo -e "\n\n# Static Code Analysis\n" >> $GITHUB_STEP_SUMMARY

doc/changes/unreleased.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,23 @@
33
## 🚨 Breaking Changes
44

55
* Dropped python 3.8 support
6-
* Changed names of Documentation related nox tasks
7-
- `build-docs` -> `docs:build`
8-
- `open-docs` -> `docs:open`
9-
- `clean-docs` -> `docs:clean`
6+
* Changed names of all nox tasks
7+
8+
| Old Name | New Name | Description |
9+
|--------------------|------------------------|----------------------------------------------------------------|
10+
| fix | project:fix | Runs all automated fixes on the code base |
11+
| check | project:check | Runs all available checks on the project |
12+
| report | project:report | Collects and generates metrics summary for the workspace |
13+
| unit-tests | test:unit | Runs all unit tests |
14+
| integration-tests | test:integration | Runs all the integration tests |
15+
| coverage | test:coverage | Runs all tests (unit + integration) and reports the code coverage |
16+
| lint | lint:code | Runs the static code analyzer on the project |
17+
| type-check | lint:typing | Runs the type checker on the project |
18+
| security | lint:security | Runs the security linter on the project |
19+
| build-build | docs:build | Builds the project documentation |
20+
| open-open | docs:open | Opens the built project documentation |
21+
| clean-docs | docs:clean | Removes the documentations build folder |
22+
| prepare-release | release:prepare | Prepares the project for a new release |
1023

1124
## ✨ Added
1225

doc/developer_guide/development.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This can be achieved by running the following command:
1717

1818
.. code-block:: shell
1919
20-
nox -s prepare-release -- <major>.<minor>.<patch>
20+
nox -s release:prepare -- <major>.<minor>.<patch>
2121
2222
Replace `<major>`, `<minor>`, and `<patch>` with the appropriate version numbers.
2323
Once the PR is successfully merged, the release can be triggered (see next section).

doc/metrics.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Tooling
8484
Projects
8585
________
8686

87-
Projects can run the nox task :code:`nox -s report` to generate their project metrics if they are using the :code:`exasol-toolbox`.
87+
Projects can run the nox task :code:`nox -s project:report` to generate their project metrics if they are using the :code:`exasol-toolbox`.
8888

8989

9090
Development

doc/user_guide/getting_started.rst

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Execute the unit tests of the project:
7777

7878
.. code-block:: shell
7979
80-
nox -s unit-tests
80+
nox -s test:unit
8181
8282
8383
.. _existing:
@@ -184,17 +184,20 @@ You are ready to use the toolbox. With *nox -l* you can list all available tasks
184184
$ nox -l
185185
Sessions defined in <PATH_TO_YOUR_PROJECT>/noxfile.py:
186186
187-
* fix -> Runs all automated fixes on the code base
188-
- check -> Runs all available checks on the project
189-
- lint -> Runs the linter on the project
190-
- type-check -> Runs the type checker on the project
191-
- unit-tests -> Runs all unit tests
192-
- integration-tests -> Runs the all integration tests
193-
- coverage -> Runs all tests (unit + integration) and reports the code coverage
187+
* project:fix -> Runs all automated fixes on the code base
188+
- project:check -> Runs all available checks on the project
189+
- project:report -> Collects and generates metrics summary for the workspace
190+
- test:unit -> Runs all unit tests
191+
- test:integration -> Runs the all integration tests
192+
- test:coverage -> Runs all tests (unit + integration) and reports the code coverage
193+
- lint:code -> Runs the static code analyzer on the project
194+
- lint:typing -> Runs the type checker on the project
195+
- lint:security -> Runs the security linter on the project
196+
- docs:multiversion -> Builds the multiversion project documentation
194197
- docs:build -> Builds the project documentation
195198
- docs:open -> Opens the built project documentation
196199
- docs:clean -> Removes the documentations build folder
197-
- report -> Collects and generates a metrics summary for the workspace
200+
- release:prepare -> Prepares the project for a new release.
198201
199202
sessions marked with * are selected, sessions marked with - are skipped.
200203

exasol/toolbox/nox/_documentation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def _build_multiversion_docs(session: nox.Session, config: Config) -> None:
3838

3939
@nox.session(name="docs:multiversion", python=False)
4040
def build_multiversion(session: Session) -> None:
41-
"""Builds the project documentation"""
41+
"""Builds the multiversion project documentation"""
4242
_build_multiversion_docs(session, PROJECT_CONFIG)
4343

4444

exasol/toolbox/nox/_format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def _pyupgrade(session: Session, files: Iterable[str]) -> None:
3333
)
3434

3535

36-
@nox.session(python=False)
36+
@nox.session(name="project:fix", python=False)
3737
def fix(session: Session) -> None:
3838
"""Runs all automated fixes on the code base"""
3939
py_files = [f"{file}" for file in python_files(PROJECT_CONFIG.root)]

exasol/toolbox/nox/_lint.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,21 @@ def _security_lint(session: Session, files: Iterable[str]) -> None:
6565
)
6666

6767

68-
@nox.session(python=False)
68+
@nox.session(name="lint:code", python=False)
6969
def lint(session: Session) -> None:
70-
"""Runs the linter on the project"""
70+
"Runs the static code analyzer on the project"
7171
py_files = [f"{file}" for file in python_files(PROJECT_CONFIG.root)]
7272
_pylint(session, py_files)
7373

7474

75-
@nox.session(name="type-check", python=False)
75+
@nox.session(name="lint:typing", python=False)
7676
def type_check(session: Session) -> None:
7777
"""Runs the type checker on the project"""
7878
py_files = [f"{file}" for file in python_files(PROJECT_CONFIG.root)]
7979
_type_check(session, py_files)
8080

8181

82-
@nox.session(name="security", python=False)
82+
@nox.session(name="lint:security", python=False)
8383
def security_lint(session: Session) -> None:
8484
"""Runs the security linter on the project"""
8585
py_files = [f"{file}" for file in python_files(PROJECT_CONFIG.root)]

exasol/toolbox/nox/_metrics.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from noxconfig import PROJECT_CONFIG
1414

1515

16-
@nox.session(name="report", python=False)
16+
@nox.session(name="project:report", python=False)
1717
def report(session: Session) -> None:
1818
"""
1919
Collects and generates metrics summary for the workspace
@@ -28,11 +28,12 @@ def report(session: Session) -> None:
2828
* :code:`rm .coverage .lint.txt`
2929
3030
* Run the following targets:
31-
- :code:`nox -s coverage`
32-
- :code:`nox -s lint`
31+
- :code:`nox -s test:coverage`
32+
- :code:`nox -s lint:code`
33+
- :code:`nox -s lint:security`
3334
"""
3435
formats = tuple(fmt.name.lower() for fmt in Format)
35-
usage = "nox -s report -- [options]"
36+
usage = "nox -s project:report -- [options]"
3637
parser = argparse.ArgumentParser(
3738
description="Generates status report for the project", usage=usage
3839
)
@@ -51,7 +52,7 @@ def report(session: Session) -> None:
5152
)
5253
if not all(file.exists() for file in required_files):
5354
session.error(
54-
"Please make sure you run the `coverage`, `security` and the `lint` target first"
55+
"Please make sure you run the `test:coverage`, `lint:security` and the `lint:code` target first"
5556
)
5657
sha1 = str(
5758
session.run("git", "rev-parse", "HEAD", external=True, silent=True)

0 commit comments

Comments
 (0)