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

spec helpers getting flagged #454

Closed
stakach opened this issue Mar 7, 2024 · 1 comment
Closed

spec helpers getting flagged #454

stakach opened this issue Mar 7, 2024 · 1 comment
Assignees

Comments

@stakach
Copy link

stakach commented Mar 7, 2024

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
Copy link
Member

Sija commented Mar 9, 2024

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:

  • add the files/folders glob(s) as a part of rule's Excluded setting
  • add the helper files/folders as a part the rule configuration, see IgnoredDirs and IgnoredFilenames properties:
    ignored_dirs %w[spec/support spec/fixtures spec/data]
    ignored_filenames %w[spec_helper]

@Sija Sija closed this as completed Mar 9, 2024
@Sija Sija self-assigned this Mar 9, 2024
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