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

Use re.match(pattern, include) for ignored include patterns #77

Merged
merged 1 commit into from
Jan 13, 2023

Conversation

storypku
Copy link
Contributor

@storypku storypku commented Jan 10, 2023

If instead we use re.search(pattern, include), include baz/a/b.h will be matched against pattern a/.*, which should be an unexpected behavior.

@storypku
Copy link
Contributor Author

storypku commented Jan 10, 2023

@martis42 Maybe we should document the code that was used to match against ignored include patterns and provides some more examples.

@storypku storypku force-pushed the jiaming/ignore_pattern branch 2 times, most recently from ce4caae to 68e5a74 Compare January 10, 2023 15:49
@martis42
Copy link
Owner

I believe you have a point. Still, I would like to think this through in detail. For today my time budget for DWYU is exhausted.
I will come back to you.

Copy link
Owner

@martis42 martis42 left a comment

Choose a reason for hiding this comment

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

@storypku
I agree with your proposal. This is indeed the preferable behavior. I will take care of improving the documentation after this has been merged.

However, please change the test case as requested.

@storypku
Copy link
Contributor Author

@storypku I agree with your proposal. This is indeed the preferable behavior. I will take care of improving the documentation after this has been merged.

However, please change the test case as requested.

Done. Please help re-review.

@@ -2,6 +2,6 @@
"ignore_include_patterns": [
"foo/.*",
"bar/.*",
"./ignored_sub_path/.*"
"\\w+/ignored_sub_path/.*"
]
Copy link
Contributor Author

@storypku storypku Jan 12, 2023

Choose a reason for hiding this comment

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

Should we add also an acceptance test case here for ingore_include_patterns to mismatch?

Copy link
Owner

Choose a reason for hiding this comment

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

Good proposal. I will do so.

@@ -2,6 +2,6 @@
"ignore_include_patterns": [
"foo/.*",
"bar/.*",
"./ignored_sub_path/.*"
"\\w+/ignored_sub_path/.*"
]
Copy link
Owner

Choose a reason for hiding this comment

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

Good proposal. I will do so.

If instead we use `re.search(pattern, include)`, include `baz/a/b.h` will be
matched against pattern 'a/.*', which should be an unexpected behavior.
@martis42 martis42 merged commit e4f4a12 into martis42:main Jan 13, 2023
@storypku storypku deleted the jiaming/ignore_pattern branch January 14, 2023 00:35
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.

None yet

2 participants