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

lsp: Support file ignore config #620

Merged
merged 1 commit into from
Apr 4, 2024
Merged

lsp: Support file ignore config #620

merged 1 commit into from
Apr 4, 2024

Conversation

charlieegan3
Copy link
Member

@charlieegan3 charlieegan3 commented Apr 3, 2024

Fixes: #589

This PR makes the filtering logic support a new rootDir prefix. When set, this will be stripped from file paths before testing their ignore status.

Screen.Recording.2024-04-03.at.15.35.31.mov

Fixes: #589

This PR makes the filtering logic support a new rootDir prefix. When
set, this will be stripped from file paths before testing their ignore
status. I have tried to add tests to explain the new functionality.

Signed-off-by: Charlie Egan <charlie@styra.com>
Copy link
Member

@anderseknert anderseknert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

@@ -12,7 +12,12 @@ import (
"github.com/open-policy-agent/opa/bundle"
)

func FilterIgnoredPaths(paths, ignore []string, checkFileExists bool) ([]string, error) {
func FilterIgnoredPaths(paths, ignore []string, checkFileExists bool, rootDir string) ([]string, error) {
Copy link
Member

@anderseknert anderseknert Apr 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change, I guess, but hopefully not one anyone has come to rely on 😬 And if they did, it should be easy to fix.

Long term, I'm hoping we can have this removed entirely in favor of doing all filtering / config work in Rego, so good thing we have that beta disclaimer in the readme stil 😅

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed on slack, after being unable to find any public integrations based on this we have opted to merge and leave a note in the release.

@anderseknert anderseknert merged commit 9081abf into main Apr 4, 2024
3 checks passed
@anderseknert anderseknert deleted the lsp-ignore-files branch April 4, 2024 08:53
srenatus pushed a commit to srenatus/regal that referenced this pull request Oct 1, 2024
Fixes: StyraInc#589

This PR makes the filtering logic support a new rootDir prefix. When
set, this will be stripped from file paths before testing their ignore
status. I have tried to add tests to explain the new functionality.

Signed-off-by: Charlie Egan <charlie@styra.com>
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

Successfully merging this pull request may close these issues.

Wildcard expressions in global ignore config not respected
2 participants