Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ insert_final_newline = true

[*.py]
indent_size = 4
max_line_length = 100
max_line_length = 120
17 changes: 17 additions & 0 deletions .github/actionlint-matcher.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
]
}
2 changes: 1 addition & 1 deletion .github/workflows/close-inactive-issues.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
tests:
uses: ./.github/workflows/test.yml
uses: ./.github/workflows/test.yaml

publish-to-pypi:
name: Publish to PyPI
Expand All @@ -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'

Expand All @@ -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
Expand All @@ -70,15 +70,15 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- 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'
# cache: 'poetry'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/secret-scanning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ jobs:
fetch-depth: 0
- name: Secret Scanning
uses: trufflesecurity/trufflehog@main
with:
extra_args: --results=verified,unknown
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/workflow-lint.yaml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# yamllint configuration file: https://yamllint.readthedocs.io/
extends: relaxed

rules:
line-length: disable

9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Directories
SRC_PATHS := project_name/ test/ # TODO
YAML_PATHS := .github/

# Targets
.PHONY: help
Expand All @@ -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)"
Expand Down Expand Up @@ -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..."
Expand All @@ -47,7 +54,7 @@ mypy:
@poetry run mypy $(SRC_PATHS)

.PHONY: lint
lint: ruff pylint mypy
lint: ruff yamllint pylint mypy

.PHONY: test
test:
Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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_"
Expand Down