Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: bruntib <bruntib@users.noreply.github.com>
  • Loading branch information
dkrupp and bruntib authored Aug 14, 2024
1 parent 07e18f2 commit 440a90b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion analyzer/codechecker_analyzer/analyzers/analyzer_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ def is_ignore_conflict_supported():
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
env=context
.get_analyzer_env("clang-apply-replacements"),
.get_analyzer_env(
os.path.basename(context.replacer_binary)),
encoding="utf-8", errors="ignore")
out, _ = proc.communicate()
return '--ignore-insert-conflict' in out
Expand Down
8 changes: 5 additions & 3 deletions analyzer/codechecker_analyzer/analyzers/clangsa/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def parse_clang_help_page(
help_page = subprocess.check_output(
command,
stderr=subprocess.STDOUT,
env=analyzer_context.get_context().get_analyzer_env("clangsa"),
env=analyzer_context.get_context()\
.get_analyzer_env(ClangSA.ANALYZER_NAME),
universal_newlines=True,
encoding="utf-8",
errors="ignore")
Expand Down Expand Up @@ -207,7 +208,8 @@ def ctu_capability(cls):
if not cls.__ctu_autodetection:
cls.__ctu_autodetection = CTUAutodetection(
cls.analyzer_binary(),
analyzer_context.get_context().get_analyzer_env("clangsa"))
analyzer_context.get_context()\
.get_analyzer_env(ClangSA.ANALYZER_NAME))

return cls.__ctu_autodetection

Expand Down Expand Up @@ -606,7 +608,7 @@ def construct_result_handler(self, buildaction, report_output,
def construct_config_handler(cls, args):

context = analyzer_context.get_context()
environ = context.get_analyzer_env("clangsa")
environ = context.get_analyzer_env(ClangSA.ANALYZER_NAME)

handler = config_handler.ClangSAConfigHandler(environ)

Expand Down
6 changes: 3 additions & 3 deletions analyzer/codechecker_analyzer/analyzers/clangtidy/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def get_analyzer_checkers(cls):
return cls.__analyzer_checkers

environ = analyzer_context\
.get_context().get_analyzer_env("clang-tidy")
.get_context().get_analyzer_env(cls.ANALYZER_NAME)
result = subprocess.check_output(
[cls.analyzer_binary(), "-list-checks", "-checks=*"],
env=environ,
Expand Down Expand Up @@ -299,7 +299,7 @@ def get_checker_config(cls):
result = subprocess.check_output(
[cls.analyzer_binary(), "-dump-config", "-checks=*"],
env=analyzer_context.get_context()
.get_analyzer_env("clang-tidy"),
.get_analyzer_env(cls.ANALYZER_NAME),
universal_newlines=True,
encoding="utf-8",
errors="ignore")
Expand All @@ -316,7 +316,7 @@ def get_analyzer_config(cls):
result = subprocess.check_output(
[cls.analyzer_binary(), "-dump-config", "-checks=*"],
env=analyzer_context.get_context()
.get_analyzer_env("clang-tidy"),
.get_analyzer_env(cls.ANALYZER_NAME),
universal_newlines=True,
encoding="utf-8",
errors="ignore")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def construct_config_handler(cls, args):
# No cppcheck arguments file was given in the command line.
LOG.debug_analyzer(aerr)

check_env = context.get_analyzer_env("cppcheck")
check_env = context.get_analyzer_env(cls.ANALYZER_NAME)

# Overwrite PATH to contain only the parent of the cppcheck binary.
if os.path.isabs(Cppcheck.analyzer_binary()):
Expand Down

0 comments on commit 440a90b

Please sign in to comment.