Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[analyzer] Add a new flag to demote missing checker errors to a warning #3866

Merged

Conversation

Szelethus
Copy link
Contributor

Altough discouraged, if someone really insists on having a soft warning when a checker is supplied to --enable or --disable, they can use the new flag '--no-missing-checker-error', which is disabled by default.

@Szelethus Szelethus added CLI 💻 Related to the command-line interface, such as the cmd, store, etc. commands analyzer 📈 Related to the analyze commands (analysis driver) labels Apr 5, 2023
@Szelethus Szelethus added this to the release 6.22.0 milestone Apr 5, 2023
@Szelethus Szelethus force-pushed the demote_err_to_warn_flag_for_missing_check branch from 21da47a to 16d8425 Compare April 5, 2023 15:15
Copy link
Contributor

@vodorok vodorok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my very minor nitpicks, but LGTM. Thanks for the tests.

analyzer/tests/functional/analyze/test_analyze.py Outdated Show resolved Hide resolved
analyzer/tests/functional/analyze/test_analyze.py Outdated Show resolved Hide resolved
action='store_true',
required=False,
default=argparse.SUPPRESS,
help="Emit a warning instead of an error when "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe include the recommendation from the commit message here too, that it is not advised to use this feature.

LOG.warning(diag_msg)
else:
LOG.error(diag_msg)
LOG.info("If you want to suppress errors relating to unknown "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe include the recommendation from the commit message here too, that it is not advised to use this feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've considered this, and it usually is my jam to shove my will down on anyones throat, but I figured that any one person that switches an error to a warning must know what they are doing.

Copy link
Contributor

@bruntib bruntib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor remarks, otherwise looks good.

analyzer/codechecker_analyzer/cmd/analyze.py Outdated Show resolved Hide resolved
analyzer/codechecker_analyzer/analyzer.py Outdated Show resolved Hide resolved
analyzer/codechecker_analyzer/cmd/check.py Outdated Show resolved Hide resolved
@Szelethus Szelethus force-pushed the demote_err_to_warn_flag_for_missing_check branch from 16d8425 to 6fa0e55 Compare April 12, 2023 16:17
@Szelethus Szelethus requested a review from vodorok April 12, 2023 16:18
@@ -1065,7 +1101,7 @@ def test_analyzer_and_checker_config(self):
cwd=self.test_dir,
encoding="utf-8",
errors="ignore")
out, _ = process.communicate()
out, err = process.communicate()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
out, err = process.communicate()
out, _ = process.communicate()

PyLint is complaining about this unused variable, otherwise it looks good.

@Szelethus Szelethus force-pushed the demote_err_to_warn_flag_for_missing_check branch from 6fa0e55 to 58e84b7 Compare April 13, 2023 11:00
Altough discouraged, if someone really insists on having a soft warning
when a checker is supplied to --enable or --disable, they can use the
new flag '--no-missing-checker-error', which is disabled by default.
@Szelethus Szelethus force-pushed the demote_err_to_warn_flag_for_missing_check branch from 58e84b7 to 7ce90c6 Compare April 13, 2023 11:10
@Szelethus Szelethus requested a review from bruntib April 13, 2023 11:30
Copy link
Contributor

@vodorok vodorok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vodorok vodorok merged commit a591c31 into Ericsson:master Apr 13, 2023
Szelethus added a commit to Szelethus/codechecker that referenced this pull request Apr 15, 2024
…ecker-error

'CodeChecker analyze' was correctly turning errors into warnings when
invoked with --no-missing-checker-error, but 'CodeChecker check' wasn't.
Szelethus added a commit to Szelethus/codechecker that referenced this pull request Apr 15, 2024
…ecker-error

'CodeChecker analyze' was correctly turning errors into warnings when
invoked with --no-missing-checker-error, but 'CodeChecker check' wasn't.
bruntib added a commit that referenced this pull request Apr 23, 2024
…ng_chk

Fix a bug in #3866 where check didn't respect --no-missing-checker-error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer 📈 Related to the analyze commands (analysis driver) CLI 💻 Related to the command-line interface, such as the cmd, store, etc. commands
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants