An opinionated linter for Transifex Projects
It consists of the following parts:
docker run --rm \
--user ${USER_ID}:${GROUP_ID} \
--mount src="$(pwd)",target=/src,type=bind \
transifex/txlint --files \
file_1.py /path/to/file_2.py
git diff origin/devel..$(git rev-parse HEAD) --name-only | \
xargs docker run --rm \
--user $(id -u):$(id -g) \
--mount src="$(pwd)",target=/src,type=bind \
transifex/txlint --files
pre-commit:
git diff origin/devel..$(git rev-parse HEAD) --name-only | \
xargs docker run --rm \
--user $$(id -u):$$(id -g) \
--mount src="$(pwd)",target=/src,type=bind \
transifex/txlint --files
- Ideally you would have a
Makefile
containing the previous example: - Add the following stage in your
Jenkinsfile
:stage('Run linter') { when { anyOf { changeRequest() } } steps { sh 'make pre-commit' } }