From d7d4500bf51ada10c25c0fe7d9490dcf783b4482 Mon Sep 17 00:00:00 2001 From: Marvin Gaube Date: Sat, 25 Nov 2023 17:36:10 +0100 Subject: [PATCH] feat: add linting CI job --- .github/workflows/lint.yaml | 15 +++++++++++++++ pyproject.toml | 10 ++++++++++ 2 files changed, 25 insertions(+) create mode 100644 .github/workflows/lint.yaml diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..215c305 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,15 @@ +--- +name: Lint +on: + push: + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: pipx install hatch + - run: hatch run ci:check + # temporary allow failures on pylint until we've fixed all issues + - run: hatch run ci:lint || exit 0 diff --git a/pyproject.toml b/pyproject.toml index a7ad9bc..7e0772c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,3 +38,13 @@ paperless-asn-qr-codes = "paperless_asn_qr_codes.main:main" [tool.hatch.version] source = "vcs" + +[tool.hatch.envs.ci] +dependencies = [ + "pylint", + "ruff", +] + +[tool.hatch.envs.ci.scripts] +check = "ruff check paperless_asn_qr_codes" +lint = "pylint paperless_asn_qr_codes"