Skip to content

Commit

Permalink
Add .editorconfig pre-commit check (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonagestam authored Apr 19, 2022
1 parent 4a7a2e3 commit 0461b69
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 13 deletions.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
- main
pull_request:

# 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
Expand Down
27 changes: 17 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,62 @@ default_language_version:
python: python3.10
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: "v4.1.0"
hooks:
- id: check-case-conflict
- id: check-merge-conflict
- id: end-of-file-fixer
- id: trailing-whitespace
- id: debug-statements
- id: detect-private-key
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: "2.4.0"
hooks:
- id: editorconfig-checker
alias: ec
args:
- -disable-indent-size
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
rev: "v2.31.1"
hooks:
- id: pyupgrade
args:
- --py37-plus
- repo: https://github.com/myint/autoflake
rev: v1.4
rev: "v1.4"
hooks:
- id: autoflake
args:
- --in-place
- --remove-all-unused-imports
- --ignore-init-module-imports
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: "5.10.1"
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.3.0
rev: "22.3.0"
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
rev: "v1.12.1"
hooks:
- id: blacken-docs
additional_dependencies: ["black==22.1.0"]
additional_dependencies: ["black==22.3.0"]
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
rev: "3.9.2"
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-comprehensions
- flake8-tidy-imports
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.14.2
rev: "0.14.2"
hooks:
- id: check-github-workflows
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.942
rev: "v0.942"
hooks:
- id: mypy
args: []
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
exclude Makefile
exclude .editorconfig
recursive-exclude docs *
recursive-exclude examples *
recursive-exclude .github *
Expand Down
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,6 @@ branch = True
skip_covered = True
show_missing = True
exclude_lines =
pragma: no cover
# ignore non-implementations
^\s*\.\.\.
pragma: no cover
# ignore non-implementations
^\s*\.\.\.

0 comments on commit 0461b69

Please sign in to comment.