Skip to content

Commit

Permalink
Merge pull request #4307 from bruntib/dont_enable_by_suffix
Browse files Browse the repository at this point in the history
[fix] Don't enable checkers by suffix
  • Loading branch information
dkrupp authored Aug 2, 2024
2 parents 082ee5e + 75f6a1f commit 62791cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 1 addition & 2 deletions analyzer/codechecker_analyzer/analyzers/config_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ def set_checker_enabled(self, checker_name, enabled=True):
changed_states = []

for ch_name, values in self.__available_checkers.items():
if ch_name.startswith(checker_name) or \
ch_name.endswith(checker_name):
if ch_name.startswith(checker_name):
_, description = values
state = CheckerState.ENABLED if enabled \
else CheckerState.DISABLED
Expand Down
7 changes: 7 additions & 0 deletions analyzer/tests/unit/test_checker_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,13 @@ def f(checks, checkers):
self.assertTrue(all_with_status(CheckerState.DISABLED)
(cfg_handler.checks(), cert_guideline))

cfg_handler = ClangSA.construct_config_handler(args)
cfg_handler.initialize_checkers(checkers,
[('default', False),
('DeadStores', True)])
self.assertTrue(all_with_status(CheckerState.DISABLED)
(cfg_handler.checks(), default_profile))

# Enable "LOW" severity checkers.
cfg_handler = ClangSA.construct_config_handler(args)
cfg_handler.initialize_checkers(checkers,
Expand Down

0 comments on commit 62791cb

Please sign in to comment.