Skip to content

update rules from LLVM tools#2270

Merged
guwirth merged 1 commit intoSonarOpenCommunity:masterfrom
guwirth:llvmorg-14
Nov 2, 2021
Merged

update rules from LLVM tools#2270
guwirth merged 1 commit intoSonarOpenCommunity:masterfrom
guwirth:llvmorg-14

Conversation

@guwirth
Copy link
Copy Markdown
Collaborator

@guwirth guwirth commented Oct 30, 2021

  • tag: llvmorg-14-init-8123-ga875e6e1225a
  • new clang tidy rules:
    • altera-id-dependent-backward-branch
    • bugprone-easily-swappable-parameters
    • bugprone-implicit-widening-of-multiplication-result
    • bugprone-suspicious-memory-comparison
    • bugprone-unhandled-exception-at-new
    • cert-exp42-c
    • cert-flp37-c
    • cppcoreguidelines-virtual-class-destructor
    • readability-data-pointer
    • readability-identifier-length
    • readability-suspicious-call-argument
  • new clang diagnostic rules:
    • clang-diagnostic-aix-compat
    • clang-diagnostic-argument-undefined-behaviour
    • clang-diagnostic-attribute-warning
    • clang-diagnostic-bitwise-instead-of-logical
    • clang-diagnostic-cast-function-type
    • clang-diagnostic-cxx-attribute-extension
    • clang-diagnostic-delimited-escape-sequence-extension
    • clang-diagnostic-deprecated-altivec-src-compat
    • clang-diagnostic-deprecated-copy-with-dtor
    • clang-diagnostic-deprecated-copy-with-user-provided-copy
    • clang-diagnostic-deprecated-copy-with-user-provided-dtor
    • clang-diagnostic-deprecated-pragma
    • clang-diagnostic-final-macro
    • clang-diagnostic-frame-larger-than
    • clang-diagnostic-gpu-maybe-wrong-side
    • clang-diagnostic-ignored-availability-without-sdk-settings
    • clang-diagnostic-ignored-reference-qualifiers
    • clang-diagnostic-interrupt-service-routine
    • clang-diagnostic-linker-warnings
    • clang-diagnostic-microsoft-abstract
    • clang-diagnostic-module-lock
    • clang-diagnostic-null-pointer-subtraction
    • clang-diagnostic-openmp-51-extensions
    • clang-diagnostic-pedantic-macros
    • clang-diagnostic-pre-openmp-51-compat
    • clang-diagnostic-redundant-consteval-if
    • clang-diagnostic-reserved-identifier
    • clang-diagnostic-reserved-macro-identifier
    • clang-diagnostic-restrict-expansion
    • clang-diagnostic-search-path-usage
    • clang-diagnostic-tautological-unsigned-char-zero-compare
    • clang-diagnostic-unreachable-code-fallthrough
    • clang-diagnostic-unused-but-set-parameter
    • clang-diagnostic-unused-but-set-variable
  • new clang-sa rules:
    • cplusplus.StringChecker

This change is Reviewable

@guwirth guwirth added this to the 2.0.6 milestone Oct 30, 2021
@guwirth guwirth self-assigned this Oct 30, 2021
* tag: llvmorg-14-init-8123-ga875e6e1225a
* new clang tidy rules:
  * altera-id-dependent-backward-branch
  * bugprone-easily-swappable-parameters
  * bugprone-implicit-widening-of-multiplication-result
  * bugprone-suspicious-memory-comparison
  * bugprone-unhandled-exception-at-new
  * cert-exp42-c
  * cert-flp37-c
  * cppcoreguidelines-virtual-class-destructor
  * readability-data-pointer
  * readability-identifier-length
  * readability-suspicious-call-argument
* new clang diagnostic rules:
  * clang-diagnostic-aix-compat
  * clang-diagnostic-argument-undefined-behaviour
  * clang-diagnostic-attribute-warning
  * clang-diagnostic-bitwise-instead-of-logical
  * clang-diagnostic-cast-function-type
  * clang-diagnostic-cxx-attribute-extension
  * clang-diagnostic-delimited-escape-sequence-extension
  * clang-diagnostic-deprecated-altivec-src-compat
  * clang-diagnostic-deprecated-copy-with-dtor
  * clang-diagnostic-deprecated-copy-with-user-provided-copy
  * clang-diagnostic-deprecated-copy-with-user-provided-dtor
  * clang-diagnostic-deprecated-pragma
  * clang-diagnostic-final-macro
  * clang-diagnostic-frame-larger-than
  * clang-diagnostic-gpu-maybe-wrong-side
  * clang-diagnostic-ignored-availability-without-sdk-settings
  * clang-diagnostic-ignored-reference-qualifiers
  * clang-diagnostic-interrupt-service-routine
  * clang-diagnostic-linker-warnings
  * clang-diagnostic-microsoft-abstract
  * clang-diagnostic-module-lock
  * clang-diagnostic-null-pointer-subtraction
  * clang-diagnostic-openmp-51-extensions
  * clang-diagnostic-pedantic-macros
  * clang-diagnostic-pre-openmp-51-compat
  * clang-diagnostic-redundant-consteval-if
  * clang-diagnostic-reserved-identifier
  * clang-diagnostic-reserved-macro-identifier
  * clang-diagnostic-restrict-expansion
  * clang-diagnostic-search-path-usage
  * clang-diagnostic-tautological-unsigned-char-zero-compare
  * clang-diagnostic-unreachable-code-fallthrough
  * clang-diagnostic-unused-but-set-parameter
  * clang-diagnostic-unused-but-set-variable
* new clang-sa rules:
  * cplusplus.StringChecker
@guwirth guwirth merged commit e8ff85c into SonarOpenCommunity:master Nov 2, 2021
@johan-boule
Copy link
Copy Markdown

Can you please remind what happens when the plugin sees a warning it doesn't know about in a clang report/log file ?
Does it

  • skip the warning,
  • error and bail out,
  • transform it into a generic uncategorized sonar rule ?

@guwirth
Copy link
Copy Markdown
Collaborator Author

guwirth commented Dec 31, 2021

Hi @johan-boule,

looking in the code:

.forRule(RuleKey.of(getRuleRepositoryKey(), ruleId))

https://github.com/SonarSource/sonarqube/blob/83b1e2d1b7aeee70413fb705eac2592f56b2ebe1/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/NewIssue.java#L87

Save the issue. If rule key is unknown or rule not enabled in the current quality profile then a warning is logged but no exception is thrown.

Means message is skipped and you should see a warning in the scanner LOG file.

Regards,

@guwirth guwirth deleted the llvmorg-14 branch July 26, 2022 09:06
@guwirth guwirth restored the llvmorg-14 branch July 26, 2022 09:15
@guwirth guwirth deleted the llvmorg-14 branch February 8, 2023 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants