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

GH-19 clarified leading slash in the spec #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. Copyright (c) 2019--2024 EditorConfig Team
.. Copyright (c) 2019--2025 EditorConfig Team
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -189,6 +189,9 @@ directory of ``.editorconfig`` or any other directory below one that stores this
However, the glob ``subdir/*.c`` only matches files that end
with ``.c`` in the ``subdir`` directory in the directory of ``.editorconfig``.

Therefore, a leading slash is not relevant if there is already a slash in the middle of the pattern.
Thus, the globs `/subdir/*.c` and `subdir/*.c` must yield the same result.

As a corollary, a section name ending with ``/`` does not match any file.

The backslash character (``\\``) can be used to escape a character so it is
Expand Down Expand Up @@ -417,3 +420,4 @@ this specification.
.. _plugin-tests repository: https://github.com/editorconfig/editorconfig-plugin-tests
.. _Semantic Versioning 2.0.0: https://semver.org/spec/v2.0.0.html
.. _specification repository: https://github.com/editorconfig/specification