add pipepline for checking lint issues
Signed-off-by: prashant-gurung899 <prasantgrg777@gmail.com>
This commit is contained in:
+23
@@ -272,6 +272,7 @@ def main(ctx):
|
|||||||
|
|
||||||
test_pipelines = \
|
test_pipelines = \
|
||||||
codestyle(ctx) + \
|
codestyle(ctx) + \
|
||||||
|
checkGherkinLint(ctx) + \
|
||||||
checkTestSuitesInExpectedFailures(ctx) + \
|
checkTestSuitesInExpectedFailures(ctx) + \
|
||||||
buildWebCache(ctx) + \
|
buildWebCache(ctx) + \
|
||||||
getGoBinForTesting(ctx) + \
|
getGoBinForTesting(ctx) + \
|
||||||
@@ -732,6 +733,28 @@ def checkTestSuitesInExpectedFailures(ctx):
|
|||||||
},
|
},
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
def checkGherkinLint(ctx):
|
||||||
|
return [{
|
||||||
|
"kind": "pipeline",
|
||||||
|
"type": "docker",
|
||||||
|
"name": "check-gherkin-standard",
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"name": "lint-feature-files",
|
||||||
|
"image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION,
|
||||||
|
"commands": [
|
||||||
|
"npm install -g @gherlint/gherlint@1.1.0",
|
||||||
|
"make test-gherkin-lint",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"trigger": {
|
||||||
|
"ref": [
|
||||||
|
"refs/pull/**",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}]
|
||||||
|
|
||||||
def codestyle(ctx):
|
def codestyle(ctx):
|
||||||
pipelines = []
|
pipelines = []
|
||||||
|
|
||||||
|
|||||||
@@ -112,6 +112,10 @@ help:
|
|||||||
@echo -e "\tmake test-php-style\t\t${BLUE}run PHP code style checks${RESET}"
|
@echo -e "\tmake test-php-style\t\t${BLUE}run PHP code style checks${RESET}"
|
||||||
@echo -e "\tmake test-php-style-fix\t\t${BLUE}run PHP code style checks and fix any issues found${RESET}"
|
@echo -e "\tmake test-php-style-fix\t\t${BLUE}run PHP code style checks and fix any issues found${RESET}"
|
||||||
@echo
|
@echo
|
||||||
|
@echo -e "${GREEN}Tools for linting gherkin feature files:\n${RESET}"
|
||||||
|
@echo -e "\tmake test-gherkin-lint\t\t${BLUE}run lint checks on Gherkin feature files${RESET}"
|
||||||
|
@echo -e "\tmake test-gherkin-lint-fix\t${BLUE}apply lint fixes to gherkin feature files${RESET}"
|
||||||
|
@echo
|
||||||
|
|
||||||
.PHONY: clean-tests
|
.PHONY: clean-tests
|
||||||
clean-tests:
|
clean-tests:
|
||||||
@@ -235,6 +239,14 @@ golangci-lint-fix:
|
|||||||
$(MAKE) --no-print-directory -C $$mod golangci-lint-fix; \
|
$(MAKE) --no-print-directory -C $$mod golangci-lint-fix; \
|
||||||
done
|
done
|
||||||
|
|
||||||
|
.PHONY: test-gherkin-lint
|
||||||
|
test-gherkin-lint:
|
||||||
|
gherlint tests/acceptance/features -c tests/acceptance/config/.gherlintrc.json
|
||||||
|
|
||||||
|
.PHONY: test-gherkin-lint-fix
|
||||||
|
test-gherkin-lint-fix:
|
||||||
|
gherlint --fix tests/acceptance/features -c tests/acceptance/config/.gherlintrc.json
|
||||||
|
|
||||||
.PHONY: bingo-update
|
.PHONY: bingo-update
|
||||||
bingo-update: $(BINGO)
|
bingo-update: $(BINGO)
|
||||||
$(BINGO) get -l -v
|
$(BINGO) get -l -v
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"rules": {
|
||||||
|
"indentation": "error",
|
||||||
|
"no_repetitive_step_keyword": "error",
|
||||||
|
"require_step": "error",
|
||||||
|
"no_trailing_whitespace": "error",
|
||||||
|
"require_scenario": "error",
|
||||||
|
"no_then_as_first_step": "error",
|
||||||
|
"only_given_step_in_background": "error",
|
||||||
|
"newline_before_scenario": ["error", 2, true],
|
||||||
|
"lowercase_title": "off",
|
||||||
|
"no_but_in_given_when": "error"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user