Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ansible Linter is not enabled #1252

Closed
tabacha opened this issue Feb 6, 2022 · 3 comments · Fixed by #3697
Closed

Ansible Linter is not enabled #1252

tabacha opened this issue Feb 6, 2022 · 3 comments · Fixed by #3697
Labels
bug Something isn't working

Comments

@tabacha
Copy link

tabacha commented Feb 6, 2022

Describe the bug
Ansible linter is not run, but i enabled it.

To Reproduce
Steps to reproduce the behavior:

npx mega-linter-runner -e 'ENABLE=ANSIBLE' -e 'SHOW_ELAPSED_TIME=true'

Retruns:

Pulling docker image megalinter/megalinter:v5 ... 
INFO: this operation can be long during the first use of mega-linter-runner
The next runs, it will be immediate (thanks to docker cache !)
v5: Pulling from megalinter/megalinter
Digest: sha256:4b189679ac34fd96b2afb28c746025205004acc4beb9b54b0bdcf2b6bc4f235f
Status: Image is up to date for megalinter/megalinter:v5
docker.io/megalinter/megalinter:v5
Command: docker run -v /var/run/docker.sock:/var/run/docker.sock:rw -v /home/sven/src/adfc/adfc-ansible:/tmp/lint:rw -e ENABLE=ANSIBLE -e SHOW_ELAPSED_TIME=true megalinter/megalinter:v5
[config] Environment variables only (no config file found in /tmp/lint)
----------------------------------------------------------------------------------------------------
-------------------------------------------- MegaLinter --------------------------------------------
----------------------------------------------------------------------------------------------------
 - Image Creation Date: 2022-02-03T02:57:58Z
 - Image Revision: 739a485b6
 - Image Version: v5
----------------------------------------------------------------------------------------------------
The MegaLinter documentation can be found at:
 - https://megalinter.github.io
----------------------------------------------------------------------------------------------------
GITHUB_REPOSITORY: 
GITHUB_REF: 
GITHUB_RUN_ID: 


SNAKEMAKE_SNAKEFMT has been temporary disabled in MegaLinter, please use a previous MegaLinter version or wait for the next one !
Skipped linters: ACTION_ACTIONLINT, ANSIBLE_ANSIBLE_LINT, ARM_ARM_TTK, BASH_EXEC, BASH_SHELLCHECK, BASH_SHFMT, CLOJURE_CLJ_KONDO, CLOUDFORMATION_CFN_LINT, COFFEE_COFFEELINT, COPYPASTE_JSCPD, CPP_CPPLINT, CREDENTIALS_SECRETLINT, CSHARP_DOTNET_FORMAT, CSS_SCSS_LINT, CSS_STYLELINT, C_CPPLINT, DART_DARTANALYZER, DOCKERFILE_DOCKERFILELINT, DOCKERFILE_HADOLINT, EDITORCONFIG_EDITORCONFIG_CHECKER, ENV_DOTENV_LINTER, GHERKIN_GHERKIN_LINT, GIT_GIT_DIFF, GO_GOLANGCI_LINT, GO_REVIVE, GRAPHQL_GRAPHQL_SCHEMA_LINTER, GROOVY_NPM_GROOVY_LINT, HTML_HTMLHINT, JAVASCRIPT_ES, JAVASCRIPT_PRETTIER, JAVASCRIPT_STANDARD, JAVA_CHECKSTYLE, JSON_ESLINT_PLUGIN_JSONC, JSON_JSONLINT, JSON_PRETTIER, JSON_V8R, JSX_ESLINT, KOTLIN_KTLINT, KUBERNETES_KUBEVAL, LATEX_CHKTEX, LUA_LUACHECK, MARKDOWN_MARKDOWNLINT, MARKDOWN_MARKDOWN_LINK_CHECK, MARKDOWN_MARKDOWN_TABLE_FORMATTER, MARKDOWN_REMARK_LINT, OPENAPI_SPECTRAL, PERL_PERLCRITIC, PHP_BUILTIN, PHP_PHPCS, PHP_PHPLINT, PHP_PHPSTAN, PHP_PSALM, POWERSHELL_POWERSHELL, PROTOBUF_PROTOLINT, PUPPET_PUPPET_LINT, PYTHON_BANDIT, PYTHON_BLACK, PYTHON_FLAKE8, PYTHON_ISORT, PYTHON_MYPY, PYTHON_PYLINT, RAKU_RAKU, RST_RSTCHECK, RST_RSTFMT, RST_RST_LINT, RUBY_RUBOCOP, RUST_CLIPPY, R_LINTR, SALESFORCE_SFDX_SCANNER_APEX, SALESFORCE_SFDX_SCANNER_AURA, SALESFORCE_SFDX_SCANNER_LWC, SCALA_SCALAFIX, SNAKEMAKE_LINT, SNAKEMAKE_SNAKEFMT, SPELL_CSPELL, SPELL_MISSPELL, SQL_SQLFLUFF, SQL_SQL_LINT, SQL_TSQLLINT, SWIFT_SWIFTLINT, TEKTON_TEKTON_LINT, TERRAFORM_CHECKOV, TERRAFORM_KICS, TERRAFORM_TERRAFORM_FMT, TERRAFORM_TERRAGRUNT, TERRAFORM_TERRASCAN, TERRAFORM_TFLINT, TSX_ESLINT, TYPESCRIPT_ES, TYPESCRIPT_PRETTIER, TYPESCRIPT_STANDARD, VBDOTNET_DOTNET_FORMAT, XML_XMLLINT, YAML_PRETTIER, YAML_V8R, YAML_YAMLLINT
To receive reports as email, please set variable EMAIL_REPORTER_EMAIL

..........................................................................................----------
......................-:./-:::-.............................................................--------
...................---:--:-::-:+/-........................................................----------
................../-....-----..---/:.....................................................-----------
.................-:.....---.......-//.................________________..................------------
................-....-:++-://+/....-/-.............../                \.................-----------
................-..-+so//::://://.../:............../     Je suis      \...............------------
................-.-+hyhs:-:+ohy+/-..-/.............<    le lama NUL :) |...............-------------
...............:/.-:oso+::-oyys/::..-o-.............\_________________/.............-.-------------
..............-ooo+:++s+yy+/ss/:-/..:o/............................................-..--------------
..............-+oo///:::oyo:--/:....-+/............................................-.---------------
.............../ys+:::+oyyy+........-/y-...................---::-/++/-/:-..........-----------------
.............../ssyy++sso+/:---:/-..--s-................--:o+---.:/+/:::-+///:-.-.------------------
...............-sososhhhyyso+/---.....+/...........-://+++/::-.....----::::::ss+--------------------
...............:+s+//+/+///:-....--::.-s-......-:/+o+/-.-----------------------:++:-----------------
...............:s+ydy++////::/::/+::/-.s/..:/oo+/:...--------------------..------:+:---------------:
...............:y-+ysysss++oo+/:sdo:-..sho+++/-..-.../-./:------------------:::::::+:--------------:
...............-s-:/:/++++///:/::o/--../y+-......-..--..o:--------+/:-:::--:-:::::-:o--------------:
...............-s--+oo/+//////:/:::-...-y+o++:-....-+sso+sss+:---:///:+::::+y/:-:---/o-------------:
...............++-::+s/+://////:::-.....+s:--://-...-syys--::y-.--::::::/:::hy::----ss-------------:
...........--..s:--:-----::////::-......//.-:--//:-...:+y:..-+-.--/-:+://:::sh/o+-:oyy-------------:
....----..-.---+-.-----:-::///:--.....-/:o:/::++o+:.....:o-.......--:o/+o/::oo+omo:y+h--------------
-...--::://:o+++/.-:-::::///:::--.-::/:-//-/::+/:+/....../-.-:-----:-:o+o//:s:/ymsosys----:---------
--.....--:::/:-+s-/so+o+::::::::-::::-:/:..-:::so/-+--.------/+:----:-+y//:+y++ysoy+h://:-----------
------.----:::/:+/:+soossssoso++/+o//+:------::/y/::---------/+/:---:-:s::/yo+oy+osoh+oo/:::-------:
------------:+s::/-:osssosysso++/+/---------/::/y/:----------o/::--:-:/y+/oso+o+ssoyh++s+----------:
----:::/+:---//--/:-/+oo++oo/+/::::--------////:/:----------:s::::-/-:/yy++y+sysosyy+/////::------::
--------::--------o/-:/o+//o:::::////:----:s:/h/////:-::--+/++::::////odoysyshsoshs+++/+///:------::
------------------:+//::////////+///------oo:os+///:://::/o:+/://++o++shohoyyo+/+++++/+////:-----:::
-------------:-----/o++++++o++//:::::---:+/+:://///:-//://++o:/oso+oshhso+/////++///++++/::------:::
:----------------:/++s+/:/+/:::::::---/s++//://///::-///+/sdossyyys+++///////+hs+/+/+/+/::-------:::
+--------:---::-:+++++++:---:--:/:/+oshsoo:///////////soo+yo/////+////++//////syssssso/----------:::
-------------++//+/++//++++++so/+ossssso+:/+yo+oohhsyyo+++o++++++//+++ho+/////////:::::----------:::
------------/+o+/////+//+/+ssyyhhyshmhdyhhhssyyoo+////++/+///+o/+///://///:::--------------------:::
---------------/+///+++++++++//+/+hho+o/+o+////::::::---------:::-:::::::::-----------//--------::::
------------------If you do not want to see me, define PRINT_ALPACA: false  ------------------------
----------------------------------------------------------------------------------------------------

    
Listing all files in directory [/tmp/lint], then filter with:
- Excluding .gitignored files [3]: /tmp/lint/.ansible-lint~, /tmp/lint/adfc-ansible.code-workspace, /tmp/lint/test.yml~
Kept [0] files on [437] found files

+----MATCHING LINTERS-+----------+----------------+------------+
| Descriptor | Linter | Criteria | Matching files | Format/Fix |
+------------+--------+----------+----------------+------------+


+----SUMMARY-+--------+------+-------+-------+--------+--------------+
| Descriptor | Linter | Mode | Files | Fixed | Errors | Elapsed time |
+------------+--------+------+-------+-------+--------+--------------+

You could have same capabilities but better runtime performances if you use a MegaLinter flavor:
- [ci_light] megalinter/megalinter/flavors/ci_light@v5 (13 linters) https://megalinter.github.io/flavors/ci_light/
- [documentation] megalinter/megalinter/flavors/documentation@v5 (39 linters) https://megalinter.github.io/flavors/documentation/
- [dart] megalinter/megalinter/flavors/dart@v5 (40 linters) https://megalinter.github.io/flavors/dart/
- [ruby] megalinter/megalinter/flavors/ruby@v5 (40 linters) https://megalinter.github.io/flavors/ruby/
- [rust] megalinter/megalinter/flavors/rust@v5 (40 linters) https://megalinter.github.io/flavors/rust/
- [scala] megalinter/megalinter/flavors/scala@v5 (40 linters) https://megalinter.github.io/flavors/scala/
- [swift] megalinter/megalinter/flavors/swift@v5 (40 linters) https://megalinter.github.io/flavors/swift/
- [go] megalinter/megalinter/flavors/go@v5 (41 linters) https://megalinter.github.io/flavors/go/
- [java] megalinter/megalinter/flavors/java@v5 (41 linters) https://megalinter.github.io/flavors/java/
- [salesforce] megalinter/megalinter/flavors/salesforce@v5 (42 linters) https://megalinter.github.io/flavors/salesforce/
- [php] megalinter/megalinter/flavors/php@v5 (44 linters) https://megalinter.github.io/flavors/php/
- [terraform] megalinter/megalinter/flavors/terraform@v5 (45 linters) https://megalinter.github.io/flavors/terraform/
- [dotnet] megalinter/megalinter/flavors/dotnet@v5 (46 linters) https://megalinter.github.io/flavors/dotnet/
- [javascript] megalinter/megalinter/flavors/javascript@v5 (48 linters) https://megalinter.github.io/flavors/javascript/
- [python] megalinter/megalinter/flavors/python@v5 (48 linters) https://megalinter.github.io/flavors/python/

[Updated Sources Reporter] No source file has been formatted or fixed
::set-output name=has_updated_sources::0
✅ Successfully linted all files without errors

Expected behavior

The Ansible linter is running.

@tabacha tabacha added the bug Something isn't working label Feb 6, 2022
@nvuillam
Copy link
Member

nvuillam commented Feb 6, 2022

Please could you run MegaLinter with LOG_LEVEL: DEBUG ?

A reason could be that your directory containing ansible files is not named ansible

You can solve that by defining variable ANSIBLE_DIRECTORY with the name of your directory containing ansible files, and it will be detected :)

@tabacha
Copy link
Author

tabacha commented Feb 6, 2022

Hi @nvuillam
I can confirm that it worked with:

npx mega-linter-runner -e 'ENABLE=ANSIBLE' -e 'SHOW_ELAPSED_TIME=true' -e ANSIBLE_DIRECTORY=.

@tabacha tabacha closed this as completed Feb 6, 2022
@nvuillam
Copy link
Member

nvuillam commented Feb 6, 2022

Glad it worked :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants