Skip to content

Commit

Permalink
(closes #30) add basic formatting and linting pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
qdbp committed Oct 7, 2024
1 parent 2f7b4ad commit c7eb4ab
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ruff.yaml
Original file line number Diff line number Diff line change
@@ -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"
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
13 changes: 9 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[project]
requires-python = ">=3.11"

[tool.poetry]
name = "entropix"
version = "0.1.0"
Expand Down Expand Up @@ -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
Expand All @@ -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

0 comments on commit c7eb4ab

Please sign in to comment.