-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Clarify the behavior of leading slash in section title #19
Comments
I'd stick with the
|
I fully share this "confusion" and agree with @florianb that it would be best to match the behavior of
(... just not "current working directory", but the location of But unlike for @dail8859, the @xuhdev's comment editorconfig/editorconfig-core-test#37 (comment) that was supposed to answer "So does a pattern starting with / have any special meaning?" doesn't clarify the difference for me:
Well, right now both editorconfig-core-test / [path/separator]
key1=value1
[/top/of/path]
key2=value2 # Tests path separator match
new_ec_test(path_separator path_separator.in path/separator "^key1=value1[ \t\n\r]*$")
# Tests path separator match below top of path
new_ec_test(nested_path_separator path_separator.in nested/path/separator "^[ \t\n\r]*$") # Tests path separator match top of path only
new_ec_test(top_level_path_separator path_separator.in top/of/path "^key2=value2[ \t\n\r]*$")
# Tests path separator match top of path only
new_ec_test(top_level_path_separator_neg path_separator.in not/top/of/path "^[ \t\n\r]*$") When you ignore the misleading comments, you see that the corresponding pairs of tests assert exactly the same behavior: new_ec_test(path_separator path_separator.in path/separator "^key1=value1[ \t\n\r]*$")
new_ec_test(top_level_path_separator path_separator.in top/of/path "^key2=value2[ \t\n\r]*$")
new_ec_test(nested_path_separator path_separator.in nested/path/separator "^[ \t\n\r]*$")
new_ec_test(top_level_path_separator_neg path_separator.in not/top/of/path "^[ \t\n\r]*$") As both @dail8859 and @florianb suggested, I also think that it makes more sense to follow the behavior of # Tests path separator match below top of path
-new_ec_test(nested_path_separator path_separator.in nested/path/separator "^[ \t\n\r]*$")
+new_ec_test(nested_path_separator path_separator.in nested/path/separator "^key1=value1[ \t\n\r]*$") Not only do I think that more people will be familiar with how First of all, it feels more consistent with "bare" file name patterns without slashes - a Furthermore, when you consider that one use case of The worst thing that can happen when you interpret |
See the confusion in editorconfig/editorconfig-core-test#37 (comment)
The text was updated successfully, but these errors were encountered: