Skip to content

Commit

Permalink
Bug 1766262 - move clang-tidy arguments for clangd from cli to spcifi…
Browse files Browse the repository at this point in the history
…c file. r=marco

Differential Revision: https://phabricator.services.mozilla.com/D144577
  • Loading branch information
abpostelnicu committed Apr 27, 2022
1 parent 5f73d94 commit 84d1b1f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ ID
**/.projectile

# User files that may appear at the root
/.clang-tidy
/.mozconfig*
/mozconfig*
/configure
Expand Down
1 change: 1 addition & 0 deletions .hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ compile_commands\.json
\.projectile

# User files that may appear at the root
^\.clang-tidy
^\.mozconfig
^mozconfig*
^configure$
Expand Down
12 changes: 10 additions & 2 deletions python/mozbuild/mozbuild/backend/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,19 @@ def setup_vscode(command_context, vscode_cmd):
"--pch-storage",
"memory",
"--clang-tidy",
"--clang-tidy-checks",
",".join(clang_tidy_cfg.checks),
],
}

clang_tidy = {}
clang_tidy["Checks"] = ",".join(clang_tidy_cfg.checks)
clang_tidy.update(clang_tidy_cfg.checks_config)

# Write .clang-tidy yml
import yaml

with open(".clang-tidy", "w") as file:
yaml.dump(clang_tidy, file)

# Load the existing .vscode/settings.json file, to check if if needs to
# be created or updated.
try:
Expand Down

0 comments on commit 84d1b1f

Please sign in to comment.