Skip to content

Commit

Permalink
Add licenseheaders to pre-commit, add license template
Browse files Browse the repository at this point in the history
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
  • Loading branch information
hakonanes committed Jan 1, 2025
1 parent b11329e commit acd9fe1
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 16 deletions.
16 changes: 16 additions & 0 deletions .license.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Copyright 2019-${years} the ${projectname} developers

This file is part of ${projectname}.

${projectname} is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

${projectname} is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with ${projectname}. If not, see <http://www.gnu.org/licenses/>.
58 changes: 42 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,43 @@
##
## Copyright 2019-2025 the kikuchipy developers
##
## This file is part of kikuchipy.
##
## kikuchipy is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## kikuchipy is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with kikuchipy. If not, see <http://www.gnu.org/licenses/>.##
repos:
# https://black.readthedocs.io/en/stable/index.html
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.8.0
hooks:
- id: black
- id: black-jupyter
files: \.ipynb
args: [--line-length=77]
# https://pycqa.github.io/isort/
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
args:
[--profile=black, --filter-files, --force-sort-within-sections]
# https://black.readthedocs.io/en/stable/index.html
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.10.0
hooks:
- id: black
- id: black-jupyter
files: \.ipynb
args: [--line-length=77]
# https://pycqa.github.io/isort/
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
args:
[--profile=black, --filter-files, --force-sort-within-sections]
- repo: https://github.com/johann-petrak/licenseheaders.git
rev: 'v0.8.8'
hooks:
- id: licenseheaders
args: ["-t", ".license.tmpl", "-cy", "-n", "kikuchipy", "-f"]

# https://pre-commit.ci
ci:
autofix_prs: false

0 comments on commit acd9fe1

Please sign in to comment.