Skip to content

Commit

Permalink
ci: add black and isort
Browse files Browse the repository at this point in the history
  • Loading branch information
Rizhiy committed Mar 11, 2024
1 parent 32efd5d commit 1228682
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test_and_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
- uses: isort/isort-action@v1
- name: Install dependencies
run: |
pip install --upgrade pip
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ pip install pycs
- Install dev dependencies: `pip install -e ".[dev]"`
- For linting and basic fixes [ruff](https://docs.astral.sh/ruff/) is used: `ruff check . --fix`
- This repository follows strict formatting style which will be checked by the CI.
To properly format the code, use the [black](https://black.readthedocs.io) format: `black .`
- To format the code, use the [black](https://black.readthedocs.io) format: `black .`
- To sort the imports, user [isort](https://pycqa.github.io/isort/) utility: `isort .`
- To test code, use [pytest](https://pytest.org): `pytest .`
- This repository follows semantic-release, which means all commit messages have to follow a [style](https://python-semantic-release.readthedocs.io/en/latest/commit-parsing.html).
You can use tools like [commitizen](https://github.com/commitizen-tools/commitizen) to write your commits.
Expand Down
1 change: 1 addition & 0 deletions pycs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Python Configuration System"""

from __future__ import annotations

from .helpers import get_output_dir
Expand Down
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ addopts = "--doctest-modules"

[tool.black]
line-length = 120
skip-magic-trailing-comma = true
# skip-magic-trailing-comma = true

[tool.isort]
profile = "black"
line_length = 120

[tool.yamlfix]
line_length = 120
Expand All @@ -55,7 +59,7 @@ select = ["A", "ARG", "B", "BLE", "C4", "COM", "E", "ERA", "F", "FBT", "FIX", "F
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
ignore = ["A003", "E203", "FIX002", "FURB113", "N817", "PTH123", "RET503", "S113", "TD002", "TD003", "TRY003", "UP007", "UP035"]
[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"**/__init__.py" = [
"F401", # Allow unused imports in module files
]
Expand Down
4 changes: 2 additions & 2 deletions tests/test_pickle.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from __future__ import annotations

# ruff: noqa

import pickle

from pycs import CL, CN

# ruff: noqa


def test_leaf_pickle():
leaf = CL(str)
Expand Down

0 comments on commit 1228682

Please sign in to comment.