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

Question: Is there a way to allow "ansible-test sanity" but disallow "sanity"? #234

Open
richm opened this issue Sep 20, 2022 · 4 comments
Labels
question Further information is requested

Comments

@richm
Copy link

richm commented Sep 20, 2022

The ansible-test sanity command is used in some places in our code. I would like to configure woke to allow the string ansible-test sanity, but have an error anywhere else the string sanity is used.

@github-actions
Copy link
Contributor

👋 Thanks for submitting your first issue!

Please be sure to read and follow our Code of Conduct and Contributing guide.

⭐️ Is your org or open source project using woke? If so, we'd love for you to be included in the 'Who uses woke' list at https://github.com/get-woke/woke/blob/main/docs/about.md#who-uses-woke.

@richm
Copy link
Author

richm commented Sep 20, 2022

Another question - Can woke scan for filenames? I don't mean the contents of files, I mean the names of files and directories? For example, ansible-test sanity requires the project to have a directory named tests/sanity/. I would like to be able to scan for problematic file/directory names, and have rules to allow certain ones (like tests/sanity/).

@richm
Copy link
Author

richm commented Sep 20, 2022

The ansible-test sanity command is used in some places in our code. I would like to configure woke to allow the string ansible-test sanity, but have an error anywhere else the string sanity is used.

It doesn't look like woke supports this. In our case, I think we can use # wokeignore:rule=sanity judiciously.

@caitlinelfring
Copy link
Member

Woke doesn't support if word == "sanity" then true; except if word == "ansible-test sanity"; then false, but there's an open PR to allow full customization via regex - #133, if you could figure out a way to get regex to work for your use-case, then maybe. But otherwise, ignoring is the way to go

Yes, woke does scan filenames and shows it as a finding at line/start column/end column of 1

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

No branches or pull requests

2 participants