From b2a266b5d9fe8dca1cdace5fddeba618fc5cace0 Mon Sep 17 00:00:00 2001 From: Charles Brunet Date: Wed, 30 Apr 2025 15:13:26 -0400 Subject: format: use absolute paths to find .editorconfig Fixes #14538. Resolve the source file path before searching .editorconfig files, to ensure parents up to the root directory are visited. --- mesonbuild/mformat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mesonbuild/mformat.py') diff --git a/mesonbuild/mformat.py b/mesonbuild/mformat.py index 1e134f5cb..b9cdeb30c 100644 --- a/mesonbuild/mformat.py +++ b/mesonbuild/mformat.py @@ -837,7 +837,7 @@ class Formatter: # See https://editorconfig.org/ config = EditorConfig() - for p in source_file.parents: + for p in source_file.resolve().parents: editorconfig_file = p / '.editorconfig' if not editorconfig_file.exists(): continue -- cgit v1.2.3