diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8b6d940ff4..a9cb5732f7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,6 +39,7 @@ repos: CMakeLib/testCTestResourceSpec_data/spec13 | RunCMake/CTestResourceAllocation/invalid )\.json + - id: check-toml - id: check-yaml - id: end-of-file-fixer # NOTE Exclude tests directory: some test files have no @@ -102,13 +103,14 @@ repos: - id: rst-inline-touching-normal - repo: https://github.com/codespell-project/codespell - rev: v2.4.0 + rev: v2.4.1 hooks: - id: codespell stages: [commit-msg, pre-commit] - - repo: https://github.com/crate-ci/typos - rev: v1.30.0 + # NOTE See BUG https://github.com/crate-ci/typos/issues/390 + - repo: https://github.com/adhtruong/mirrors-typos + rev: v1.33.1 hooks: - id: typos # NOTE Override hook's default args to prevent automatic diff --git a/.typos.toml b/.typos.toml index 5ad2245aa7..6838bb7036 100644 --- a/.typos.toml +++ b/.typos.toml @@ -5,10 +5,10 @@ check-file = true check-filename = true extend-ignore-re = [ - # NOTE Allow to mark a block of text to exclude from spellchecking - "(?s)(#|/(/|\\*)|\\.\\.)\\s*(NOQA|noqa):? spellcheck(: *|=| +)off.*?\\n\\s*(#|/(/|\\*)|\\.\\.)\\s*(NOQA|noqa):? spellcheck(: *|=| +)on" + # NOTE Allow to mark block of text to exclude from spellchecking inside C++ or hash-style comments (CMake,Python,&etc.) + "(?s)(#|//)\\s*(NOQA|noqa):? spellcheck(: *|=| +)off.*?\\n\\s*(#|//)\\s*(NOQA|noqa):? spellcheck(: *|=| +)on" # NOTE Allow to mark a line to exclude from spellchecking - , "(?Rm)^.*(#|/(/|\\*)|\\.\\.)\\s*(NOQA|noqa):? spellcheck(: *|=| +)disable-line$" + , "(?Rm)^.*(#|//)\\s*(NOQA|noqa):? spellcheck(: *|=| +)disable-line$" # NOTE Stop checking from this line to the end of file # This line is a marker added by Git to the `COMMIT_EDITMSG`. , "(?sm)^# ------------------------ >8 ------------------------$.*" @@ -34,7 +34,28 @@ ser = "ser" restat = "restat" # SpectreMitigation Spectre = "Spectre" +# Identifier used in source code (`GlobalTargetInfo`) +gti = "gti" +[files] +ignore-hidden = false +ignore-dot = false +extend-exclude = [ + "CONTRIBUTORS.rst" + # Exclude third-party sources. + , "Source/CursesDialog/form/" + , "Source/kwsys/" + , "Source/bindexplib.cxx" + , "Source/cmcldeps.cxx" + , "Source/QtDialog/*.ui" + , "Utilities/cm*" + , "Utilities/ClangTidyModule" + , "Utilities/KWIML" + # FIXME: Fix spelling typos in tests. Exclude for now. + , "Tests" + ] + +# BEGIN Type-specific settings [type.cmake.extend-identifiers] COMMANDs = "COMMANDs" xCOMMANDx = "xCOMMANDx" @@ -60,20 +81,9 @@ SEH = "SEH" [type.py.extend-identifiers] typ = "typ" -[files] -ignore-hidden = false -ignore-dot = false -extend-exclude = [ - "CONTRIBUTORS.rst" - # Exclude third-party sources. - , "Source/CursesDialog/form/" - , "Source/kwsys/" - , "Source/bindexplib.cxx" - , "Source/cmcldeps.cxx" - , "Source/QtDialog/*.ui" - , "Utilities/cm*" - , "Utilities/ClangTidyModule" - , "Utilities/KWIML" - # FIXME: Fix spelling typos in tests. Exclude for now. - , "Tests" +[type.rst] +extend-ignore-re = [ + # NOTE Allow to mark block of text to exclude from spellchecking as RST comments + "(?s)\\.\\.\\s+(NOQA|noqa):? spellcheck(: *|=| +)off.*?\\n\\.\\.\\s+(NOQA|noqa):? spellcheck(: *|=| +)on" ] +# END Type-specific settings diff --git a/Source/cmGeneratorTarget_Sources.cxx b/Source/cmGeneratorTarget_Sources.cxx index fa27998ae3..ed002e450e 100644 --- a/Source/cmGeneratorTarget_Sources.cxx +++ b/Source/cmGeneratorTarget_Sources.cxx @@ -96,10 +96,11 @@ void addFileSetEntry(cmGeneratorTarget const* headTarget, } cmake* cm = headTarget->GetLocalGenerator()->GetCMakeInstance(); for (auto& entryCge : fileSet->CompileFileEntries()) { - auto tpe = cmGeneratorTarget::TargetPropertyEntry::CreateFileSet( - dirs, contextSensitiveDirs, std::move(entryCge), fileSet); - entries.Entries.emplace_back( - EvaluateTargetPropertyEntry(headTarget, config, "", dagChecker, *tpe)); + auto targetPropEntry = + cmGeneratorTarget::TargetPropertyEntry::CreateFileSet( + dirs, contextSensitiveDirs, std::move(entryCge), fileSet); + entries.Entries.emplace_back(EvaluateTargetPropertyEntry( + headTarget, config, "", dagChecker, *targetPropEntry)); EvaluatedTargetPropertyEntry const& entry = entries.Entries.back(); for (auto const& file : entry.Values) { auto* sf = headTarget->Makefile->GetOrCreateSource(file);