Skip to content

Commit

Permalink
chore: Incorporate copyright check in pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
aiven-anton committed Feb 1, 2023
1 parent 0a10ddd commit 1fd5ff7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,3 @@ jobs:

- name: Run all pre-commit hooks
run: pre-commit run --all-files

copyright:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Enforce copyright headers
run: make copyright
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ repos:
exclude: ^vendor/|^tests/.*/fixtures/.*|^tests/integration/test_data/.*
- id: debug-statements

- repo: local
hooks:
- id: copyright
name: copyright
language: system
types: [python]
exclude: ^vendor/
pass_filenames: false
# Lists the Python files that do not have an Aiven copyright. Exits with a
# non-zero exit code if any are found.
entry: bash -c "! git grep --untracked -ELm1 'Copyright \(c\) 20[0-9]{2} Aiven' -- '*.py' ':!*__init__.py'"

- repo: https://github.com/asottile/pyupgrade
rev: "v3.3.1"
hooks:
Expand Down
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,3 @@ clean:

karapace/version.py: version.py
$(PYTHON) $^ $@

# Lists the Python files that do not have an Aiven copyright. Exits with a
# non-zero exit code if any are found.
.PHONY: copyright
copyright:
! git grep --untracked -ELm1 'Copyright \(c\) 20[0-9]{2} Aiven' -- '*.py' ':!*__init__.py'

0 comments on commit 1fd5ff7

Please sign in to comment.