Skip to content

Commit

Permalink
Merge pull request #200 from mautrix/pre-commit-config
Browse files Browse the repository at this point in the history
pre-commit: add configuration
  • Loading branch information
sumnerevans authored Jan 21, 2022
2 parents c535bff + db6a45b commit 6cb9685
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ trim_trailing_whitespace = false
[*.{yaml,yml,py,md}]
indent_style = space

[{.gitlab-ci.yml,*.md,.github/workflows/*.yml}]
[{.gitlab-ci.yml,*.md,.github/workflows/*.yml,.pre-commit-config.yaml}]
indent_size = 2
7 changes: 7 additions & 0 deletions .github/workflows/python-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ jobs:
- uses: psf/[email protected]
with:
src: "./mausignald ./mautrix_signal"
- name: pre-commit
run: |
pip install pre-commit
pre-commit run -av trailing-whitespace
pre-commit run -av end-of-file-fixer
pre-commit run -av check-yaml
pre-commit run -av check-added-large-files
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: trailing-whitespace
exclude_types: [markdown]
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
# TODO convert to use the upstream psf/black when
# https://github.com/psf/black/issues/2493 gets fixed
- repo: local
hooks:
- id: black
name: black
entry: black --check
language: system
files: ^(mausignald|mautrix_signal)/.*\.py$
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
files: ^(mausignald|mautrix_signal)/.*$
3 changes: 3 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pre-commit>=2.10.1,<3
isort>=5.10.1,<6
black==21.12b2
3 changes: 1 addition & 2 deletions mausignald/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Mozilla Public License Version 2.0
means any form of the work other than Source Code Form.

1.7. "Larger Work"
means a work that combines Covered Software with other material, in
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.

1.8. "License"
Expand Down Expand Up @@ -371,4 +371,3 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice

This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.

0 comments on commit 6cb9685

Please sign in to comment.