diff --git a/.editorconfig b/.editorconfig index 3601590..db0e5ef 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,4 +10,4 @@ insert_final_newline = true [*.py] indent_size = 4 -max_line_length = 100 +max_line_length = 120 diff --git a/.github/actionlint-matcher.json b/.github/actionlint-matcher.json new file mode 100644 index 0000000..4613e16 --- /dev/null +++ b/.github/actionlint-matcher.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "actionlint", + "pattern": [ + { + "regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$", + "file": 1, + "line": 2, + "column": 3, + "message": 4, + "code": 5 + } + ] + } + ] +} diff --git a/.github/workflows/close-inactive-issues.yaml b/.github/workflows/close-inactive-issues.yaml index 33bb665..7833b21 100644 --- a/.github/workflows/close-inactive-issues.yaml +++ b/.github/workflows/close-inactive-issues.yaml @@ -11,7 +11,7 @@ jobs: issues: write pull-requests: write steps: - - uses: actions/stale@v5 + - uses: actions/stale@v9 with: days-before-issue-stale: 90 # The number of days old an issue can be before marking it stale days-before-issue-close: 14 # The number of days to wait to close an issue after it being marked stale diff --git a/.github/workflows/codeql-analysis.yaml b/.github/workflows/codeql-analysis.yaml index 84d7dfa..edc6f63 100644 --- a/.github/workflows/codeql-analysis.yaml +++ b/.github/workflows/codeql-analysis.yaml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Initialize CodeQL uses: github/codeql-action/init@v3 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6cdc63f..0137f48 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,7 +6,7 @@ on: jobs: tests: - uses: ./.github/workflows/test.yml + uses: ./.github/workflows/test.yaml publish-to-pypi: name: Publish to PyPI @@ -20,13 +20,13 @@ jobs: permissions: id-token: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install poetry run: pipx install poetry - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.10' @@ -44,7 +44,7 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Check package version matches tag id: check-version @@ -70,7 +70,7 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -78,7 +78,7 @@ jobs: run: pipx install poetry - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.10' # cache: 'poetry' diff --git a/.github/workflows/secret-scanning.yaml b/.github/workflows/secret-scanning.yaml index 2a06946..0aa7785 100644 --- a/.github/workflows/secret-scanning.yaml +++ b/.github/workflows/secret-scanning.yaml @@ -13,3 +13,5 @@ jobs: fetch-depth: 0 - name: Secret Scanning uses: trufflesecurity/trufflehog@main + with: + extra_args: --results=verified,unknown diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 29a9cef..9445be6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,12 +17,12 @@ jobs: os: [ 'ubuntu-latest' ] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install poetry run: pipx install poetry - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} # cache: 'poetry' diff --git a/.github/workflows/workflow-lint.yaml b/.github/workflows/workflow-lint.yaml new file mode 100644 index 0000000..adbcd1d --- /dev/null +++ b/.github/workflows/workflow-lint.yaml @@ -0,0 +1,17 @@ +name: Lint GitHub Actions workflows +on: [ push, pull_request ] + +jobs: + actionlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Enable matcher for actionlint + run: echo "::add-matcher::.github/actionlint-matcher.json" + + - name: Download and run actionlint + run: | + bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) + ./actionlint -color + shell: bash diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000..f800e59 --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,6 @@ +# yamllint configuration file: https://yamllint.readthedocs.io/ +extends: relaxed + +rules: + line-length: disable + diff --git a/Makefile b/Makefile index 520ac78..a0b81b4 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ # Directories SRC_PATHS := project_name/ test/ # TODO +YAML_PATHS := .github/ # Targets .PHONY: help @@ -9,6 +10,7 @@ help: @echo " format : Format code using Ruff format" @echo " check_format : Check code formatting with Ruff format" @echo " ruff : Run Ruff linter" + @echo " yamllint : Run yamllint linter" @echo " pylint : Run Pylint linter" @echo " mypy : Run MyPy static type checker" @echo " lint : Run linters (Ruff, Pylint and Mypy)" @@ -36,6 +38,11 @@ ruff: @echo "=====> Running Ruff..." @poetry run ruff check $(SRC_PATHS) +.PHONY: yamllint +yamllint: + @echo "=====> Running yamllint..." + @poetry run yamllint $(YAML_PATHS) + .PHONY: pylint pylint: @echo "=====> Running Pylint..." @@ -47,7 +54,7 @@ mypy: @poetry run mypy $(SRC_PATHS) .PHONY: lint -lint: ruff pylint mypy +lint: ruff yamllint pylint mypy .PHONY: test test: diff --git a/pyproject.toml b/pyproject.toml index aa22781..233a097 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,11 +13,12 @@ pytest = "*" [tool.poetry.group.dev.dependencies] mypy = "*" -ruff = "*" pylint = "*" +ruff = "*" +yamllint = "*" [tool.ruff] -line-length = 100 +line-length = 120 target-version = "py310" [tool.ruff.lint] @@ -67,7 +68,7 @@ unfixable = [] line-ending = "lf" [tool.pylint.format] -max-line-length = 100 +max-line-length = 120 [tool.pylint.basic] no-docstring-rgx = "^__|^test_"