Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DCT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
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
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
graintracking
DCT
Commits
1d28d7fd
Commit
1d28d7fd
authored
3 years ago
by
Joao P C Bertoldo
Browse files
Options
Downloads
Plain Diff
Merge branch '5-git-commit-hooks'
parents
c68092ae
5b9c530d
Branches
Some-additional-functions-from-Zheheng
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.pre-commit-config.yaml
+38
-0
38 additions, 0 deletions
.pre-commit-config.yaml
README.txt
+42
-0
42 additions, 0 deletions
README.txt
pyproject.toml
+4
-0
4 additions, 0 deletions
pyproject.toml
setup.cfg
+4
-0
4 additions, 0 deletions
setup.cfg
with
88 additions
and
0 deletions
.pre-commit-config.yaml
0 → 100644
+
38
−
0
View file @
1d28d7fd
minimum_pre_commit_version
:
2.12.0
default_language_version
:
python
:
python3.8
files
:
'
zUtil_Python/.+'
exclude
:
|
(?x)^(
.+\.m|
.+\.cpp|
.+\.css|
.+\.cxx|
.+\.txx|
.+\.h|
.+\.tex|
.+\.cc|
.+\.txt|
.+\.bib|
.+\.html|
.+\.xml|
.+\.pl
)$
fail_fast
:
false
repos
:
-
repo
:
https://github.com/pre-commit/pre-commit-hooks
rev
:
v3.4.0
hooks
:
-
id
:
check-yaml
-
id
:
end-of-file-fixer
-
id
:
trailing-whitespace
-
repo
:
https://github.com/psf/black
rev
:
20.8b1
# Replace by any tag/version: https://github.com/psf/black/tags
hooks
:
-
id
:
black
language_version
:
python3.8
# Should be a command that runs python3.6+
-
repo
:
https://github.com/pycqa/flake8
rev
:
'
3.9.0'
# pick a git hash / tag to point to
hooks
:
-
id
:
flake8
\ No newline at end of file
This diff is collapsed.
Click to expand it.
README.txt
+
42
−
0
View file @
1d28d7fd
...
...
@@ -110,3 +110,45 @@ $ python /users/user1/dct/dct_launch.py
9. For more information or support, contact graintracking@esrf.fr
# dev
## pre-commit hooks
[pre-commit's official website](https://pre-commit.com/)
first, let's create an isolated environment for pre-commit
```
# using a conda installation that I found at `cat $(which silx)`
os=$(/csadmin/common/scripts/get_os)
source /sware/isdd/packages/${os}/dau/miniconda3/etc/profile.d/conda.sh
# create an empty installation of python 3.8
# src: https://stackoverflow.com/a/37216638/9582881
conda create --yes --prefix $HOME/.pre-commit-env -c conda-forge python=3.8 pre-commit
```
Make the pre-commit executable accessible locally:
```
# link the executable to your local path
ln -s ~/.pre-commit-env/bin/pre-commit ~/.local/bin/
```
Now check that you have pre-commit properly installed:
```
which pre-commit
# should be like /nana/ni/nana/na/.local/bin/pre-commit
pre-commit -V
# should be >= 2.12.0
```
Finally, let's activate it for the project:
```
cd ~/dct # or wherever you put it...
pre-commit install
```
This diff is collapsed.
Click to expand it.
pyproject.toml
0 → 100644
+
4
−
0
View file @
1d28d7fd
[tool.black]
line-length
=
127
target-version
=
[
'py36'
,
'py37'
,
'py38'
]
include
=
'\.pyi?$'
\ No newline at end of file
This diff is collapsed.
Click to expand it.
setup.cfg
0 → 100644
+
4
−
0
View file @
1d28d7fd
[flake8]
max-line-length
=
127
max-complexity
=
10
ignore
=
E203, E266, E501, W503, F403, F401
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