mirror of
https://github.com/fergalmoran/picard.git
synced 2025-12-22 09:18:18 +00:00
Add an helper script to run codacy-analysis-cli locally
Used to validate .markdownlint.json
This commit is contained in:
32
scripts/tools/run_codacy_analysis.sh
Executable file
32
scripts/tools/run_codacy_analysis.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
# Run codacy-analysis-cli using markdownlint tool by default
|
||||
#
|
||||
# Optionally use the tool passed as argument
|
||||
# List is available at https://docs.codacy.com/repositories-configure/codacy-configuration-file/#which-tools-can-be-configured-and-which-name-should-i-use
|
||||
#
|
||||
# Requires docker
|
||||
# See https://github.com/codacy/codacy-analysis-cli for details
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
TOOL=markdownlint
|
||||
else
|
||||
# use tool passed as command-line argument
|
||||
TOOL="$1"
|
||||
fi
|
||||
|
||||
# change to picard source directory
|
||||
pushd "$(dirname "$0")/../../" || exit
|
||||
|
||||
CODACY_CODE="$(pwd)"
|
||||
docker run \
|
||||
--rm=true \
|
||||
--env CODACY_CODE="$CODACY_CODE" \
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
||||
--volume "$CODACY_CODE":"$CODACY_CODE":ro \
|
||||
--volume /tmp:/tmp \
|
||||
codacy/codacy-analysis-cli \
|
||||
analyze --verbose --tool "$TOOL"
|
||||
|
||||
popd
|
||||
Reference in New Issue
Block a user