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

Excluding tests directory from check #225

Open
ashrub-holvi opened this issue May 22, 2024 · 5 comments
Open

Excluding tests directory from check #225

ashrub-holvi opened this issue May 22, 2024 · 5 comments

Comments

@ashrub-holvi
Copy link

Hi! Thank you for cool project!

I am thinking about excluding test's directory from check because, at least on first steps, it's not that critical, tried to configure it in pre-commit hook

- repo: https://github.com/seddonym/import-linter/
  rev: "v2.0"
  hooks:
    - id: import-linter
      exclude: /tests/

but seems it doesn't work and probably it's expected as the tool is not file-based, is it possible to do now or, if not, do you have plans to implement something like that?

@seddonym
Copy link
Owner

seddonym commented Jun 4, 2024

Thanks for the issue! Could I clarify what you're expecting to happen? E.g. are you expecting the lint-imports command to behave differently, or do you want the command not to be called at all by precommit when you change something in the tests folder?

I'm guessing it's the first one - possibly the setting you're looking for is ignore_imports, see the docs.

@ashrub-holvi
Copy link
Author

I would expect second - not checking excluded directories at all, because it probably will be too many imports to add to ignore_imports. I still have doubt about is it good idea or not, but at least on the first steps it will simplify introducing import-linter.

@seddonym
Copy link
Owner

seddonym commented Jun 4, 2024

it probably will be too many imports to add to ignore_imports

Ignored imports supports wildcards, so you would probably be able to achieve it with just a single line in your contract.

@ashrub-holvi
Copy link
Author

it probably will be too many imports to add to ignore_imports

Ignored imports supports wildcards, so you would probably be able to achieve it with just a single line in your contract.

Yep, might be it will be enough, but I think it will ignore for all package's code, not for tests only.

@ashrub-holvi
Copy link
Author

Although it might be possible to configure it separately for tests' dir, will need to try.

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