crystal-ameba / ameba

A static code analysis tool for Crystal
https://crystal-ameba.github.io
MIT License
514 stars 35 forks source link

spec helpers getting flagged #454

Closed stakach closed 6 months ago

stakach commented 6 months ago

this seems a little overbearing. having it correctable breaks things too.

image

prefixing the file with spec_ solves the issue but that seems redundant given we're in a spec folder. also seems to flag any file in there, even if it doesn't require "spec" or have any specs in it

maybe we could update this rule to only flag files if they contain actual specs? i.e. if it's in the spec folder and has describe or it blocks in the file

Sija commented 6 months ago

Hi, first of all the overbearing adjective could be used for any perceived noise, and I don't see any specific relation to this particular rule.

Secondly, the convention is to name the helper as spec_helper.cr, which by default is ignored by SpecFilename rule.

Thirdly, you can either: