crystal-ameba/vscode-crystal-ameba

.ameba.yml config file ingored

Closed this issue · 2 comments

VSCode shows problems, which are ignored in my .ameba.yml config file. When i run ameba from command line, all is OK (no problems).

I can confirm this is an issue in Ameba itself. The path in .ameba.yml has to be converted to the absolute one.

Reproduction:

$ cat ameba/.ameba.yml                                                                                                                                                                                       
# This configuration file was generated by `ameba --gen-config`
# on 2021-04-21 10:00:29 UTC using Ameba version 0.14.3.
# The point is for the user to remove these configuration records
# one by one as the reported problems are removed from the code base.

# Problems found: 1
# Run `ameba --only Lint/UselessAssign` for details
Lint/UselessAssign:
  Description: Disallows useless variable assignments
  Excluded:
  - src/ameba/config.cr
  Enabled: true
  Severity: Warning

Working correctly

$ cd ameba
$ ameba /Users/me/Dev/repos/ameba/src/ameba/config.cr --format json --config /Users/me/Dev/repos/ameba/.ameba.yml

# no errors

Working incorrectly

$ cd ../
$ ameba /Users/me/Dev/repos/ameba/src/ameba/config.cr --format json --config /Users/me/Dev/repos/ameba/.ameba.yml

{"sources":[{"path":"/Users/me/Dev/repos/ameba/src/ameba/config.cr","issues":[{"rule_name":"Lint/UselessAssign","severity":"Warning","message":"Useless assignment to variable `test`","location":{"line":124,"column":5},"end_location":{"line":124,"column":8}}]}],"metadata":{"ameba_version":"0.14.3","crystal_version":"1.0.0"},"summary":{"target_sources_count":1,"issues_count":1}}% 

Closing in favour of crystal-ameba/ameba#231
Thanks for reporting.