6 automatically checked on every push and merge by Bitbucket pipelines. |
6 automatically checked on every push and merge by Bitbucket pipelines. |
7 |
7 |
8 To avoid pushing "unclean" code, i's recommended to add one of the following |
8 To avoid pushing "unclean" code, i's recommended to add one of the following |
9 commands to pre commit Mercurial hook into .hg/hgrc configuration file. |
9 commands to pre commit Mercurial hook into .hg/hgrc configuration file. |
10 |
10 |
|
11 Unfortunately script can't distinguish between real commit and shelve. If you |
|
12 are using shelve (or maybe some other affected commands), it's recommended to |
|
13 use pre-<command> and post-<command> hooks to create flags to skip checks on |
|
14 some operations. |
|
15 |
|
16 |
11 ``` |
17 ``` |
12 [hooks] |
18 [hooks] |
|
19 pre-shelve.linter = touch .hg/skiphook |
|
20 post-shelve.linter = rm .hg/skiphook |
13 pretxncommit.linter = ./tests/tools/check_source.sh --only-changes |
21 pretxncommit.linter = ./tests/tools/check_source.sh --only-changes |
14 ``` |
22 ``` |
15 or the same done using Docker container, so result will be the same as |
23 or the same done using Docker container, so result will be the same as |
16 on Bitbucket pipeline. |
24 on Bitbucket pipeline. |
17 |
25 |
18 ``` |
26 ``` |
19 [hooks] |
27 [hooks] |
|
28 pre-shelve.linter = touch .hg/skiphook |
|
29 post-shelve.linter = rm .hg/skiphook |
20 pretxncommit.linter = hg status -m -n -a -n -I '**.py' --change $HG_NODE > files.lst && docker run --volume=$PWD:/beremiz --workdir="/beremiz" --volume=$PWD/../CanFestival-3:/CanFestival-3 --memory=1g --entrypoint=/beremiz/tests/tools/check_source.sh skvorl/beremiz-requirements --files-to-check files.lst |
30 pretxncommit.linter = hg status -m -n -a -n -I '**.py' --change $HG_NODE > files.lst && docker run --volume=$PWD:/beremiz --workdir="/beremiz" --volume=$PWD/../CanFestival-3:/CanFestival-3 --memory=1g --entrypoint=/beremiz/tests/tools/check_source.sh skvorl/beremiz-requirements --files-to-check files.lst |
21 ``` |
31 ``` |