Skip to content

Commit

Permalink
Switch to Ruff format (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
drhagen authored Mar 3, 2024
1 parent 7ca13dd commit 16dfbef
Show file tree
Hide file tree
Showing 4 changed files with 514 additions and 509 deletions.
8 changes: 3 additions & 5 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,14 @@ This will try to test with all compatible Python versions that `nox` can find. T
poetry run nox -s test-3.9 test_pandas-3.9
```

It is good to run the tests locally before making a PR, but it is not necessary to have all Python versions run. It is rare for a failure to appear in a single version, and the CI will catch it anyway.
It is good to run the tests locally before making a PR, but it is not necessary to have all Python versions run. It is rare for a failure to appear in a single version, and the CI will catch it anyway.

## Code quality

Tabeline uses Black, isort, and Flake8 to ensure a minimum standard of code quality. The code quality commands are encapsulated with Nox:
Tabeline uses Ruff to ensure a minimum standard of code quality. The code quality commands are encapsulated with Nox:

```shell
poetry run nox -s black
poetry run nox -s isort
poetry run nox -s flake8
poetry run nox -s lint
```

## Generating the docs
Expand Down
16 changes: 8 additions & 8 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import nox
from nox import options, parametrize
from nox_poetry import Session, session

nox.options.sessions = ["test", "coverage", "lint"]
options.sessions = ["test", "coverage", "lint"]


@session(python=["3.9", "3.10", "3.11", "3.12"])
Expand All @@ -26,12 +26,12 @@ def coverage(s: Session):


@session(venv_backend="none")
def fmt(s: Session) -> None:
s.run("ruff", "check", ".", "--select", "I", "--fix")
s.run("black", ".")
@parametrize("command", [["ruff", "check", "."], ["ruff", "format", "--check", "."]])
def lint(s: Session, command: list[str]):
s.run(*command)


@session(venv_backend="none")
def lint(s: Session) -> None:
s.run("black", "--check", ".")
s.run("ruff", "check", ".")
def format(s: Session) -> None:
s.run("ruff", "check", ".", "--select", "I", "--fix")
s.run("ruff", "format", ".")
Loading

0 comments on commit 16dfbef

Please sign in to comment.