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

It's unclear whether you are using regex patterns or glob patterns #384

Open
dabrahams opened this issue May 17, 2024 · 0 comments
Open

Comments

@dabrahams
Copy link

dabrahams commented May 17, 2024

Description

For example, on the "ignoring paths" page, there's this text, which appears to be self-contradictory:

File paths will be read as regex patterns, so special characters in regex will need to be escaped using \\ prior to the character, an example being + which would require \\+ to be processed correctly.

The pattern folder/* will not match recursively in the folder.
Please use this folder/**/*, which will exclude all files within the given folder.

If patterns are simply regexes, then folder/**/* would match “folder” followed by any number of slashes (and might exhibit pathological performance problems because of the many ways to match the same string).

(You might also want to note that the matching behavior of ** is different from that of bash, in which ** matches one or more directories, not zero or more as your text implies you are doing).

I can imagine its possible that the path elements between /s are treated as regexes unless they begin with *, in which case they are treated as glob patterns… but, wow, I'm realizing the “path regexp” page is pretty confusing. If “before” is meant to show what you write in your YAML, the column header really should be “pattern appearing in YAML,” or something. Will codecov ever fail to transform a path pattern? If not, maybe it's not the case that “File paths will be read as regex patterns” at all, and they are really being read as glob patterns which are transformed internally into regexes…but no, that's not quite right as the use of $ in a “before” column shows. 🤷

Page(s)

https://docs.codecov.com/docs/ignoring-paths

https://docs.codecov.com/docs/path-regexp

Current State

[] Broken Link
[x] Unclear Language
[] Inconsistent Formatting
[x] Missing Information
[] Missing Updates for New Features
[] Deprecated Features

Additional Information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Product Owner
Development

No branches or pull requests

2 participants