diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..3a362c1 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,17 @@ +root = True + +[*] +end_of_line = lf +insert_final_newline = True +indent_style = space +indent_size = 4 +trim_trailing_whitespace = True + +[*.py] +charset = utf-8 + +[*.{yml,yaml,md,toml}] +indent_size = 2 + +[Makefile] +indent_style = tab diff --git a/.github/workflows/_ci.yaml b/.github/workflows/_ci.yaml new file mode 100644 index 0000000..a852e1d --- /dev/null +++ b/.github/workflows/_ci.yaml @@ -0,0 +1,19 @@ +name: CI +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + lint: + name: Static analysis + uses: less-action/reusables/.github/workflows/pre-commit.yaml@main + with: + python-version: "3.10" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..1178e62 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,20 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: "v4.3.0" + hooks: + - id: check-case-conflict + - id: check-merge-conflict + - id: end-of-file-fixer + - id: trailing-whitespace + - id: detect-private-key + - repo: https://github.com/editorconfig-checker/editorconfig-checker.python + rev: "2.6.1" + hooks: + - id: editorconfig-checker + alias: ec + args: + - -disable-indent-size + - repo: https://github.com/sirosen/check-jsonschema + rev: "0.18.3" + hooks: + - id: check-github-workflows