mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-07 12:50:21 -06:00
add pipepline for checking lint issues
Signed-off-by: prashant-gurung899 <prasantgrg777@gmail.com>
This commit is contained in:
23
.drone.star
23
.drone.star
@@ -272,6 +272,7 @@ def main(ctx):
|
||||
|
||||
test_pipelines = \
|
||||
codestyle(ctx) + \
|
||||
checkGherkinLint(ctx) + \
|
||||
checkTestSuitesInExpectedFailures(ctx) + \
|
||||
buildWebCache(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):
|
||||
pipelines = []
|
||||
|
||||
|
||||
12
Makefile
12
Makefile
@@ -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-fix\t\t${BLUE}run PHP code style checks and fix any issues found${RESET}"
|
||||
@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
|
||||
clean-tests:
|
||||
@@ -235,6 +239,14 @@ golangci-lint-fix:
|
||||
$(MAKE) --no-print-directory -C $$mod golangci-lint-fix; \
|
||||
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
|
||||
bingo-update: $(BINGO)
|
||||
$(BINGO) get -l -v
|
||||
|
||||
14
tests/acceptance/config/.gherlintrc.json
Normal file
14
tests/acceptance/config/.gherlintrc.json
Normal file
@@ -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