Skip to content

Commit

Permalink
Added isort and updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertoRoos committed Nov 8, 2024
1 parent 0b75af8 commit 1c1f2a4
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
- uses: py-actions/flake8@v2
with:
path: "src/ tests/"
plugins: "flake8-bugbear flake8-black"
plugins: "flake8-bugbear flake8-black flake8-isort"
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ poetry install --with dev --with doc
Documentation is built using Sphinx.
This is done automatically and hosted by [ReadTheDocs](https://about.readthedocs.com/).

### Linting

Code style is enforced with black, isort and flake8.
Format code with:
```
isort .
black .
```
And verify code with: (flake8 extensions will also perform black and isort checks)
```
flake8 ./src ./tests
```

## Tools

See RTD documentation for full overview of usage: https://twincat-tools.readthedocs.io/latest/pages/tools.html
34 changes: 33 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ GitPython= "^3.1.43"
optional = true
[tool.poetry.group.dev.dependencies]
black = "^24.10.0"
isort = "^5.13.2"
pytest = "^8.3.3"
pytest-cov = "^5.0.0"
pytest-mock = "^3.14.0"
flake8 = "^7.1.1"
flake8-bugbear = "^24.8.19"
flake8-black = "^0.3.6"
flake8-isort = "^6.1.1"

[tool.poetry.group.doc]
optional = true
Expand All @@ -48,5 +50,14 @@ tc_xml_sort = "tctools.xml_sort.__main__:main_argv"
tc_git_info = "tctools.git_info.__main__:main_argv"
tc_make_release = "tctools.make_release.__main__:main_argv"

# ----------- Other tools -----------

[tool.black]
# Empty

[tool.isort]
profile = "black"
skip_gitignore = true

# [flake8]
# See `.flake8`, no support for `pyproject.toml` yet

0 comments on commit 1c1f2a4

Please sign in to comment.