Skip to content

Commit

Permalink
chore: Add MegaLinter and linters' configs
Browse files Browse the repository at this point in the history
MegaLinter config and linter configs for:
- Dockerfiles
- Editorconfig checker
- Groovy
- Markdown
- Python
- Shell scripts
- Yaml files

Resolves #17
  • Loading branch information
turboBasic committed Dec 31, 2023
1 parent 0845b9b commit c268ce3
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .groovylintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"extends": "recommended",
"rules": {
"basic.DeadCode": "off",
"comments.ClassJavadoc": "off",
"convention.CompileStatic": "off",
"convention.MethodReturnTypeRequired": "off",
"convention.NoDef": "off",
"convention.VariableTypeRequired": "off",
"formatting.ClassStartsWithBlankLine": "info",
"formatting.ConsecutiveBlankLines": "off",
"groovyism.ExplicitCallToEqualsMethod": "off",
"groovyism.GStringExpressionWithinString": "off",
"naming.FactoryMethodName": "off",
"naming.VariableName": "off",
"serialization.SerializableClassMustDefineSerialVersionUID": "info",
"size.NestedBlockDepth": {
"maxNestedBlockDepth": 10
},
"unnecessary.UnnecessaryGetter": "off",
"unused.UnusedVariable": {
"ignoreVariableNames": "_"
}
}
}
6 changes: 6 additions & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
##########################
## Hadolint config file ##
##########################
ignored:
- DL3018
9 changes: 9 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"heading-style": {
"style": "atx"
},
"line-length": {
"line_length": 120
},
"no-multiple-blanks": false
}
32 changes: 32 additions & 0 deletions .mega-linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
ENABLE_LINTERS:
- BASH_SHELLCHECK
- DOCKERFILE_HADOLINT
- EDITORCONFIG_EDITORCONFIG_CHECKER
- GROOVY_NPM_GROOVY_LINT
- MARKDOWN_MARKDOWNLINT
- PYTHON_BLACK
- YAML_YAMLLINT

# npm-groovy-lint configuration
GROOVY_NPM_GROOVY_LINT_FILE_EXTENSIONS:
- .dsl
- .gradle
- .groovy
- .Jenkinsfile
GROOVY_NPM_GROOVY_LINT_FILE_NAMES_REGEX:
- Jenkinsfile$
GROOVY_NPM_GROOVY_LINT_ARGUMENTS: --failon error

# editorconfig checker configuration
EDITORCONFIG_EDITORCONFIG_CHECKER_FILTER_REGEX_EXCLUDE: >
(?x) ^gradlew | ^\.idea/.* | ^test/resources/callStacks/.*
# general options
CLEAR_REPORT_FOLDER: true
PRINT_ALL_FILES: true
PRINT_ALPACA: false
SHOW_ELAPSED_TIME: true

# reporter options
CONFIG_REPORTER: false
UPDATED_SOURCES_REPORTER: false
17 changes: 17 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
###########################################
# These are the rules used for #
# linting all the yaml files in the stack #
# NOTE: #
# You can disable line with: #
# # yamllint disable-line #
###########################################
extends: default
rules:
new-lines:
level: warning
type: unix
line-length:
max: 500
comments:
min-spaces-from-content: 1 # Used to follow prettier standard: https://github.com/prettier/prettier/pull/10926

0 comments on commit c268ce3

Please sign in to comment.