Skip to content

Commit 2ecce17

Browse files
feat: use the new GOFF command line (#7)
* feat: use the new GOFF command line Signed-off-by: Thomas Poignant <thomas.poignant@gofeatureflag.org> * Rename variable Signed-off-by: Thomas Poignant <thomas.poignant@gofeatureflag.org> * Don't fail if we return 0 + message Signed-off-by: Thomas Poignant <thomas.poignant@gofeatureflag.org> --------- Signed-off-by: Thomas Poignant <thomas.poignant@gofeatureflag.org>
1 parent c989319 commit 2ecce17

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

run-lint.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Reset
2-
GO_FEATURE_FLAG_LINT_DOCKER_TAG="v1"
2+
GO_FEATURE_FLAG_CLI_DOCKER_TAG="v1"
33
Color_Off='\033[0m' # Text Reset
44

55
# Regular Colors
@@ -36,8 +36,8 @@ function fmtPrintln() {
3636
}
3737

3838
## Get the image of go-feature-flag-lint from source
39-
fmtPrintln "info" "pulling the image of go-feature-flag-lint:${GO_FEATURE_FLAG_LINT_DOCKER_TAG} from source"
40-
docker pull gofeatureflag/go-feature-flag-lint:${GO_FEATURE_FLAG_LINT_DOCKER_TAG}
39+
fmtPrintln "info" "pulling the image of go-feature-flag-cli:${GO_FEATURE_FLAG_CLI_DOCKER_TAG} from source"
40+
docker pull gofeatureflag/go-feature-flag-cli:${GO_FEATURE_FLAG_CLI_DOCKER_TAG}
4141

4242
## Input arguments
4343
fmtPrintln "info" "input arguments: $1 and $2"
@@ -64,15 +64,17 @@ flagFile="$(pwd)/$1"
6464
configDir=$(dirname "$flagFile")
6565
configFile=$(basename "$flagFile")
6666

67+
echo $configFile
68+
6769
## Run the linter against the config file
6870
msg=$( { docker run -v "${configDir}":/config --rm --name gofeatureflag_lint \
69-
gofeatureflag/go-feature-flag-lint:${GO_FEATURE_FLAG_LINT_DOCKER_TAG} \
70-
--input-format="$2" \
71-
--input-file=/config/"${configFile}"; } 2>&1)
72-
71+
gofeatureflag/go-feature-flag-cli:${GO_FEATURE_FLAG_CLI_DOCKER_TAG} \
72+
lint \
73+
/config/"${configFile}" \
74+
--format="$2"; } 2>&1)
7375

7476
## Check if the linter has any errors
75-
if [[ $? != 0 || ! -z "${msg}" ]]; then
77+
if [[ $? != 0 ]]; then
7678
fmtPrintln "critical" "linting failed"
7779
fmtPrintln "critical" "$msg"
7880
exit 1

0 commit comments

Comments
 (0)