diff --git a/.github/workflows/ruff.yaml b/.github/workflows/ruff.yaml new file mode 100644 index 0000000..ec6753a --- /dev/null +++ b/.github/workflows/ruff.yaml @@ -0,0 +1,14 @@ +name: Ruff +on: [push, pull_request] +jobs: + ruff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/ruff-action@v1 + with: + src: "./entropix" + args: "format --check" + - uses: astral-sh/ruff-action@v1 + with: + args: "check entropix --diff" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..9755b95 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,9 @@ +repos: +- repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.6.2 + hooks: + # Run the linter. + - id: ruff + # Run the formatter. + - id: ruff-format diff --git a/pyproject.toml b/pyproject.toml index cadd006..e4a83d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,6 @@ +[project] +requires-python = ">=3.11" + [tool.poetry] name = "entropix" version = "0.1.0" @@ -42,7 +45,11 @@ build-backend = "poetry.core.masonry.api" [tool.ruff] extend-exclude = ["tests/**"] -lint.select = [ +line-length = 100 +indent-width = 2 + +[tool.ruff.lint] +select = [ # pycodestyle "E", # Pyflakes @@ -58,9 +65,7 @@ lint.select = [ # Ruff "RUF", ] -lint.ignore = [ +ignore = [ "E501", # ignore line-length (e.g. long docstring) "SIM117", # ignore combine with statements (it leads to harder to read code) ] -line-length = 88 -indent-width = 2