Commit 7d303478 authored by Alan O'Cais's avatar Alan O'Cais

Merge branch 'fix_linter' into 'master'

fix linter issues

Closes #36

See merge request e-cam/E-CAM-Library!239
parents d9df33ea 357d4345
Pipeline #6562 passed with stages
in 2 minutes and 15 seconds
......@@ -12,12 +12,29 @@ lint:
script:
- pip3 install doc8
- git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA
# Run linter over files in last commit (not really good enough, want all files in MR but can't do that)
- ( set -e; for file in $(git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA); do doc8 --max-line-length 120 $file; done )
# Run linter over files in last commit exclude deleted files
- ( set -e; for file in $(git diff-tree --no-commit-id --name-only --diff-filter=d -r $CI_COMMIT_SHA); do doc8 --max-line-length 120 $file; done )
only:
- merge_requests
- master
lint_MR:
# Explicit cloning to prevent git remote pollution from previous jobs
variables:
GIT_STRATEGY: clone
script:
- pip3 install doc8
# Add the target project as a remote
- git remote add upstream $CI_MERGE_REQUEST_PROJECT_URL
# fetch upstream branches
- git fetch upstream
- echo upstream/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
- git diff --no-commit-id --name-only upstream/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
# Run linter over files that diff between branch and target upstream branch
# excluding deleted files
- ( set -e; for file in $(git diff --no-commit-id --name-only --diff-filter=d upstream/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME); do doc8 --max-line-length 120 $file; done )
only:
- merge_requests
orphans:
script:
# Report all the orphans but ignore the exit code
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment