Skip to content

Commit 65a6cc4

Browse files
committed
Add linting helper script.
1 parent e78eede commit 65a6cc4

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.gitlab-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ lint:
33
- cvmfs
44
script:
55
- DHI_COMBINE_PYTHON_ONLY=1 source setup.sh
6-
- flake8 dhi --exclude dhi/tasks/postfit.py,dhi/scripts/postfit_plots.py
6+
- ./lint.sh
77

88
test:
99
when: manual

lint.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
action() {
4+
local shell_is_zsh="$( [ -z "${ZSH_VERSION}" ] && echo "false" || echo "true" )"
5+
local this_file="$( ${shell_is_zsh} && echo "${(%):-%x}" || echo "${BASH_SOURCE[0]}" )"
6+
local this_dir="$( cd "$( dirname "${this_file}" )" && pwd )"
7+
8+
(
9+
cd "${this_dir}" && \
10+
flake8 dhi --exclude dhi/tasks/postfit.py,dhi/scripts/postfit_plots.py
11+
)
12+
}
13+
action "$@"

0 commit comments

Comments
 (0)