-
Notifications
You must be signed in to change notification settings - Fork 5.5k
fix(ci): License check on yml files #26511
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
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR addresses a regex compilation error in the license-header script by updating how the file_pattern is generated and compiled—handling the '\z' escape correctly—and enhances observability with added debug logs. Class diagram for updated license-header.py scriptclassDiagram
class license_header_script {
+main()
+get_filename(filename)
+file_lines(header)
+message(log_to, msg)
-file_pattern: regex.Pattern
}
license_header_script : +file_pattern generation updated
license_header_script : +debug logging added
Flow diagram for updated file pattern generation and matchingflowchart TD
A["Start main()"] --> B["Read header file lines"]
B --> C["Generate raw_pattern using fnmatch.translate"]
C --> D["Replace '\z' with '\Z' in raw_pattern"]
D --> E["Compile pattern with regex.compile"]
E --> F["Iterate over files"]
F --> G["Get filename"]
G --> H["Log processed filename"]
H --> I["Match filename against file_pattern"]
I --> J["Process matched/unmatched files"]
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
3a16c71 to
4c02f76
Compare
004767b to
1c9540e
Compare
1c9540e to
780d1e0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @czentgr
Fixes
The problem is that
\zand\Zare interpreted as python strings before being sent to the re compiler. We indicate that it is not a python string literal by prependingr.Description
Motivation and Context
Impact
Test Plan
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.