[DO-110] created groovy linter config and action workflow for linter (#21)
created groovy linter config and action workflow for linter Reviewed-on: https://git.avroid.tech/DevOps/jenkins-shared-lib/pulls/21 Co-authored-by: Yaroslav Bondarenko <yaroslav.bondarenko@avroid.tech> Co-committed-by: Yaroslav Bondarenko <yaroslav.bondarenko@avroid.tech>
This commit is contained in:
committed by
Denis Patrakeev
parent
04d231a7fd
commit
cd2cdaae61
39
.gitea/workflows/groovy-linter.yml
Normal file
39
.gitea/workflows/groovy-linter.yml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
# Copyright Avroid, Ltd. 2023-2024
|
||||||
|
#
|
||||||
|
# You can not use the contents of the file in any way without
|
||||||
|
# AVROID, Ltd. written permission.
|
||||||
|
#
|
||||||
|
# To obtain such a permit, you should contact AVROID, Ltd.
|
||||||
|
# at https://avroid.ru
|
||||||
|
|
||||||
|
---
|
||||||
|
name: Groovy linter
|
||||||
|
run-name: ${{ gitea.actor }} is start check sources
|
||||||
|
on: [pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
linter:
|
||||||
|
name: Groovy linter
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: harbor.avroid.tech/devops/npm-groovy-lint:14.4.1-0
|
||||||
|
steps:
|
||||||
|
- run: echo "Start job on ${{ runner.name }} with os ${{ runner.os }}"
|
||||||
|
- run: echo "Work with branch ${{ gitea.ref }} repository ${{ gitea.repository }}"
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Mirrors/github-actions-checkout.git@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
persist-credentials: false
|
||||||
|
- name: Get all groovy files that have changed
|
||||||
|
id: changed-files-specific
|
||||||
|
uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Mirrors/github-actions-tj-actions-changed-files.git@v44
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
**/*.groovy
|
||||||
|
- name: Run step if any of the listed files above change
|
||||||
|
id: groovy_linter
|
||||||
|
uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Actions/npm-groovy-lint-docker-action.git@v7
|
||||||
|
with:
|
||||||
|
input_flags: "--failon error"
|
||||||
|
input_files: ${{ steps.changed-files-specific.outputs.all_changed_files }}
|
||||||
@@ -3,14 +3,13 @@
|
|||||||
"rules": {
|
"rules": {
|
||||||
"convention.CompileStatic": "off",
|
"convention.CompileStatic": "off",
|
||||||
"convention.NoDef": "off",
|
"convention.NoDef": "off",
|
||||||
"convention.VariableTypeRequired": "on",
|
|
||||||
"convention.MethodReturnTypeRequired": "off",
|
|
||||||
"groovyism.ExplicitCallToEqualsMethod": "off",
|
"groovyism.ExplicitCallToEqualsMethod": "off",
|
||||||
"groovyism.GStringExpressionWithinString": "off",
|
"groovyism.GStringExpressionWithinString": "off",
|
||||||
"naming.VariableName": {
|
"naming.VariableName": {
|
||||||
"ignoreVariableNames": "_"
|
"ignoreVariableNames": "_"
|
||||||
},
|
},
|
||||||
"naming.FactoryMethodName": "off",
|
"naming.FactoryMethodName": "off",
|
||||||
|
"naming.PropertyName": "off",
|
||||||
"unnecessary.UnnecessaryGetter": "off",
|
"unnecessary.UnnecessaryGetter": "off",
|
||||||
"size.NestedBlockDepth": {
|
"size.NestedBlockDepth": {
|
||||||
"maxNestedBlockDepth": 10
|
"maxNestedBlockDepth": 10
|
||||||
|
|||||||
Reference in New Issue
Block a user