diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml new file mode 100644 index 00000000..46b75f76 --- /dev/null +++ b/.github/workflows/black.yml @@ -0,0 +1,12 @@ +name: Lint + +on: [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: psf/black@stable + with: + options: "--check --diff --color" \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..190f3a98 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,16 @@ +repos: + # Using this mirror lets us use mypyc-compiled black, which is about 2x faster + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 24.2.0 + hooks: + - id: black + # It is recommended to specify the latest version of Python + # supported by your project here, or alternatively use + # pre-commit's default_language_version, see + # https://pre-commit.com/#top_level-default_language_version + language_version: python3.10 + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: check-yaml \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index e67678f7..ea028ef9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,3 +78,14 @@ cwl = [ [build-system] build-backend = "flit_core.buildapi" requires = ["flit_core >=3.2,<4"] + +[tool.black] +line-length = 85 +target-version = ['py310'] +include = '\.pyi?$' +exclude = ''' +/( + \.git + | \.venv +)/ +''' \ No newline at end of file