File tree Expand file tree Collapse file tree 4 files changed +43
-3
lines changed
Expand file tree Collapse file tree 4 files changed +43
-3
lines changed Original file line number Diff line number Diff line change 4444permissions : {}
4545
4646jobs :
47+ pyupgrade :
48+ name : Find Upgradable CodingStandards
49+ runs-on : ubuntu-latest
50+ timeout-minutes : 10
51+ steps :
52+ - name : Checkout
53+ # see https://github.com/actions/checkout
54+ uses : actions/checkout@v4
55+ - name : Setup Python Environment
56+ # see https://github.com/actions/setup-python
57+ uses : actions/setup-python@v5
58+ with :
59+ python-version : ${{ env.PYTHON_VERSION_DEFAULT }}
60+ architecture : ' x64'
61+ - name : Install poetry
62+ # see https://github.com/marketplace/actions/setup-poetry
63+ uses : Gr1N/setup-poetry@v9
64+ with :
65+ poetry-version : ${{ env.POETRY_VERSION }}
66+ - name : Install dependencies
67+ run : poetry install --no-root
68+ - name : Run tox
69+ run : poetry run tox run -e pyupgrade -s false
70+
4771 coding-standards :
4872 name : Linting & Coding Standards
4973 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -17,13 +17,16 @@ poetry install
1717
1818## Code style
1919
20+ THis project loves latest python features.
2021This project uses [ PEP8] Style Guide for Python Code.
21- This project loves sorted imports.
22+ This project loves sorted imports.
23+
2224Get it all applied via:
2325
2426``` shell
25- poetry run isort .
26- poetry run autopep8 -ir cyclonedx_py/ tests/
27+ poetry run -- tox r -e pyupgrade -- --exit-zero-even-if-changed
28+ poetry run -- tox r -e isort
29+ poetry run -- tox r -e autopep8
2730```
2831
2932This project prefers ` f'strings' ` over ` 'string'.format() ` .
Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ mypy = "1.16.0"
9494bandit = " 1.8.3"
9595tomli = { version = " ^2.0.1" , python = " <3.11" }
9696tox = " 4.26.0"
97+ pyupgrade = " 3.20.0"
9798
9899# min version required to be able to install some dependencies
99100# see https://github.com/MichaelKim0407/flake8-use-fstring/issues/33
Original file line number Diff line number Diff line change @@ -46,3 +46,15 @@ commands =
4646skip_install = True
4747commands =
4848 poetry run bandit -c bandit.yml -v -r cyclonedx_py tests
49+
50+ [testenv:pyupgrade]
51+ allowlist_externals = poetry, sh
52+ commands = sh -c " \
53+ find cyclonedx typings tests tools examples -type f \( -name '*.py' -or -name '*.pyi' \) -print0 \
54+ | xargs -0 poetry run pyupgrade --py39-plus {posargs} "
55+
56+ [testenv:isort]
57+ commands = poetry run isort .
58+
59+ [testenv:autopep8]
60+ commands = poetry run autopep8 --in-place -r cyclonedx typings tests tools examples
You can’t perform that action at this time.
0 commit comments