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

.ameba.yml config file ingored #8

Closed
petr-fischer opened this issue Apr 20, 2021 · 2 comments
Closed

.ameba.yml config file ingored #8

petr-fischer opened this issue Apr 20, 2021 · 2 comments

Comments

@petr-fischer
Copy link

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

@veelenga
Copy link
Member

veelenga commented Apr 21, 2021

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}}% 

@veelenga
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants