Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tikka
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
Tikka
Commits
c89534cb
Commit
c89534cb
authored
3 years ago
by
Vincent Texier
Browse files
Options
Downloads
Patches
Plain Diff
[enh] update CONTRIBUTING.md
parent
d18bf146
Branches
Branches containing commit
Tags
0.1.0
Tags containing commit
No related merge requests found
Pipeline
#13921
waiting for manual action
Stage: checks
Stage: tests
Stage: release
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
CONTRIBUTING.md
+3
-31
3 additions, 31 deletions
CONTRIBUTING.md
with
3 additions
and
31 deletions
CONTRIBUTING.md
+
3
−
31
View file @
c89534cb
# Contribute guide
## Pre-commit
We are using
[
`pre-commit`
](
https://pre-commit.com/
)
tool to perform checks on staged changes before committing.
We are using it for
`black`
formatting,
`isort`
imports sorting,
`pylint`
code linting,
`mypy`
typing, licence headers and
`gitlab-ci`
linting.
Install
`pre-commit`
from your distribution or install it from
`pip`
:
```
bash
sudo
apt
install
pre-commit
```
or
```
bash
pip
install
--user
pre-commit
```
To install the
`git-hooks`
, in the project folder, run:
```
bash
pre-commit
install
```
Then each time you commit changes, the hooks will perform checks.
To manually run one of the tool above, run (eg for
`isort`
):
```
bash
pre-commit run
--all-files
isort
```
To run all checks on all files:
```
bash
pre-commit run
-a
```
### Authorization for GitLab CI linter hook
`
pre-commit run -a (
gitlab-ci-linter
)
`
is failing due to authorization required for CI lint API accesses.
`
make
gitlab-ci-linter`
is failing due to authorization required for CI lint API accesses.
When running this command, just ignore this failed hook.
In case you want to commit a
`.gitlab-ci.yml`
edition, this hook will prevent the commit creation.
You can
[
skip the hooks
](
https://stackoverflow.com/a/7230886
)
with
`git commit -m "msg" --no-verify`
.
...
...
@@ -49,9 +21,9 @@ Check out #169 for more details.
We are using
[
Black
](
https://github.com/psf/black
)
formatter tool.
Run Black on a Python file to format it:
```
bash
poetry run black
duniterpy
/file.py
poetry run black
path
/file.py
```
With
`
pre-commit
`
, Black is called on staged files, so the commit should fail in case black would make changes.
With
`
autohooks
`
, Black is called on staged files, so the commit should fail in case black would make changes.
You will have to add Black changes in order to commit your changes.
### Update copyright year
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment