Update AnalyzerConfig.cs s_propertyMatcherPattern regex key#82585
Update AnalyzerConfig.cs s_propertyMatcherPattern regex key#82585Daynvheur wants to merge 2 commits into
Conversation
|
@dotnet-policy-service agree |
|
This a retry for the PR #78459, with a much simpler regex which only allows the space-related characters where due. |
|
I'm somewhat confused/worried about this PR. It says that its purpose is to close out #55431. However, #55431 is about having spaces in category names. And i don't see a single test that actually seems to be validating this behavior, or trying to validate the exact cases reported in that bug. This makes me feel like this hasn't been deeply looked at our thought through. |
I understand your confusion, due to two distinct flavours of "categories":
@CyrusNajmabadi: The goal here is to enable space-including key names as different hint level (sub-)categories, inside the language level category. The "category" from within the .editorconfig globs parsing was not involved, and is supposed to correctly handle spaces when relevant. Addendum: #82585 (comment) the test case for spaced key was there already, I only allowed for it in the unit test assertions. |
|
I am not comfortable with this change. It seems like it is easy to end up in situations with hangs, without people understanding why that happens. Being able to prove that the changes will not lead to other cases of that adds a ton of risk here for very low gain. |
That is your pov. The root problem breaks down like this:
Which is an overly verbose and unusual way to implement a regex. I am glad you are taking the time needed to review the PR and answer back any time either you or I need more data. I may insist the current situation is bad on my end, and I'm doing everything I can to get it polished enough it may end up having a fair and honest complete review down the line. |
|
I appreciate the work you’ve put into this. I completely understand the motivation behind these changes, and I know how frustrating it can be to work around the current inefficiencies. However, we're in a difficult position regarding the risk this introduces to the compiler's stability. The primary concern is that the PR explicitly mentions the potential for indefinite hangs, but those hangs aren't clearly identifiable or predictable just by reviewing the logic. Accepting a change where the failure mode is both high-severity and structurally opaque creates an unacceptable risk for our users. Since we don't yet have a definitive root cause or a way to prove that other scenarios won't be impacted, we can't merge this in its current state. We definitely want to find a path forward here, but we have to prioritize stability and ensure we aren't introducing regressions that are nearly impossible to diagnose in the wild. To move this forward, we really need to get to the bottom of why these patterns are triggering hangs and build in the necessary safety guardrails. Once the underlying issue is understood and mitigated, I’d be happy to take another look. |
|
I simplified the regex once more, since the multiparting was superfluous: allowing for @CyrusNajmabadi: is it worth it to keep the inline regex comment, only for those two characters added?
Both are identical, and the more recent one better blends in |
I'm ok with not having the inline-regex comment in this case. |
|
I'm forcing a branch swipe with the latest commit changing 3 characters:
|
|
@CyrusNajmabadi: modification scope is now reduced to 3 characters, and there is no failed tests left. |
|
I (forced-)retried the last commit to hope CI will have a better outcome. Edit: It worked. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as duplicate.
This comment was marked as duplicate.
|
I marked my previous comment about the regex as Off-Topic, since it may distract from the core change here. Is there something I can do to keep this issue moving forward? |
Closes dotnet#55431 Allows space characters in the key name as per [specification](https://spec.editorconfig.org/#file-format). Regex testings: https://regex101.com/r/l0FeUH/9 (Changed `\s` to `[^\S\r\n]` there only to account for multiline context, see notes) PR related to issue [dotnet#55431 (comment)](dotnet#55431 (comment)) Closes PR [!78459](dotnet#78459) Notes: * To NOT break [current](https://github.com/dotnet/roslyn/blob/1e14d8a2f9eb04b0c9b4076fdc8a7f02d5d53ab1/src/Compilers/Core/Portable/CommandLine/AnalyzerConfig.cs#L25) implementation parsing, inline comments are still available. Removing the trailing `([#;].*)?` part would solve the issue. * It's a single-line evaluation process implementation, I changed `\s` to `[^\S\r\n]` only in the multiline testing context * `[\w\.\-_]` ["a word character, or a dot, or a dash, or an underscore"] is much slower than (the previously proposed) `[^=:\s]` ["any non-whitespace character or equal or double dot"], and can't be parsed on multiline online tools with the evaluation list linked above, I thus kept the regex testings link as it was initially
goo.bar baz.quux ztesch.blah = ... (Retried)
Closes #55431
Allows space characters in the key name as per specification.
Regex testings: https://regex101.com/r/l0FeUH/9 (Changed
\sto[^\S\r\n]there only to account for multiline context, see notes)PR related to issue #55431 (comment)
Closes PR !78459
Notes:
([#;].*)?part would solve the issue.\sto[^\S\r\n]only in the multiline testing context[\w\.\-_]["a word character, or a dot, or a dash, or an underscore"] is much slower than (the previously proposed)[^=:\s]["any non-whitespace character or equal or double dot"], and can't be parsed on multiline online tools with the evaluation list linked above, I thus kept the regex testings link as it was initially