#134: Introduce insert-license hook and fixup license headers
- Change license header's comments from docstring to
#
- Introduce
insert-license
pre-commit-hook - Get rid of
update_copyright_year.sh
which becomes useless - Document how to update the copyright year
Close #134 (closed).
Edited by Moul
Merge request reports
Activity
changed milestone to %1.0.0
added Bug Dev Env Doc/Website labels
added 1 commit
- 8103b704 - [doc] #134 (closed): Document how to update the copyright year
@vtexier, can you review this one?
It seems that
examples/__init__.py
has been forgotten.When I checkout on the dev branch, commit 0719b34c, I get this when running
pre-commit run -a
:black....................................................................Passed isort....................................................................Passed mypy.....................................................................Passed pylint...................................................................Passed Insert license in comments...............................................Failed - hook id: insert-license - exit code: 1 - files were modified by this hook Some sources were modified by the hook ['examples/__init__.py'] Now aborting the commit. You should check the changes made. Then simply "git add --update ." and re-commit .gitlab-ci.yml linter....................................................Passed (.venv) vit@K72Jr:~/Documents/dev/python/duniter-python-api$ pre-commit run -a black....................................................................Passed isort....................................................................Passed mypy.....................................................................Passed pylint...................................................................Passed Insert license in comments...............................................Failed - hook id: insert-license - exit code: 1 - files were modified by this hook Some sources were modified by the hook ['examples/__init__.py', 'docs/conf.py'] Now aborting the commit. You should check the changes made. Then simply "git add --update ." and re-commit .gitlab-ci.yml linter....................................................Passed
Very cool output by the way!
The file is modified with the licence properly added, but the old licence in a docstring should be removed to fix it.
[EDIT] Very strange, this is not happening when doing a real commit with git! I let you investigate...
Edited by Vincent TexierThanks. Solved with !143 (merged).
docs
folder is ignored byinsert-license
hook.pre-commit run -a
is checking the whole code, where pre-commit run on a commit is only applying the hooks to the changed code in the stage.
Please register or sign in to reply