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

Add --file-types flag to include only specified config file types #174

Open
kehoecj opened this issue Oct 7, 2024 · 4 comments · May be fixed by #192
Open

Add --file-types flag to include only specified config file types #174

kehoecj opened this issue Oct 7, 2024 · 4 comments · May be fixed by #192
Labels
CLI Update to the CLI good first issue Good for newcomers has-pr This issue has an associated PR help wanted Extra attention is needed

Comments

@kehoecj
Copy link
Collaborator

kehoecj commented Oct 7, 2024

There isn't a way to limit the validation to only a subset of config file types. You can use --exclude-file-types to remove all the ones you do not want scanned but as that list has gotten bigger you'd have to do the following command if you only wanted JSON or XML: validator --exclude-file-types=yaml,toml,ini,properties,hcl,plist,csv,hocon,env,editorconfig. Not only is that hard to remember but even if you save the command you'd have to update it every time we add additional validation types. We need an option to specify which types to include - something like this: validator --file-types=xml,json. We need to also add CLI logic so --file-types and --exclude-file-types should not be used together.

Implementation should be fairly simple because it will be the inverse of --exclude-file-types

@kehoecj kehoecj added CLI Update to the CLI hacktoberfest 🎃 Hacktoberfest 2024 help wanted Extra attention is needed good first issue Good for newcomers update Updates including golang version, dependencies, containers, etc and removed update Updates including golang version, dependencies, containers, etc labels Oct 7, 2024
@Kinshuk0
Copy link

Kinshuk0 commented Oct 7, 2024

Hey there ! I think I can work on this, can you please assign me this ?

@kehoecj
Copy link
Collaborator Author

kehoecj commented Oct 7, 2024

@Kinshuk0 Done!

@kehoecj
Copy link
Collaborator Author

kehoecj commented Oct 23, 2024

@Kinshuk0 Haven't seen a PR for 2 weeks so opening this up to others

@gurukiran07 gurukiran07 linked a pull request Oct 25, 2024 that will close this issue
@gurukiran07
Copy link
Contributor

I think building an exclude-file-types list based on file-types can be done to avoid duplicating the code in FSFinder. I have a PR #192 for this.

Is it a good idea?

@kehoecj kehoecj added the has-pr This issue has an associated PR label Oct 25, 2024
@kehoecj kehoecj removed the hacktoberfest 🎃 Hacktoberfest 2024 label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Update to the CLI good first issue Good for newcomers has-pr This issue has an associated PR help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants