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

misc: Add gen-compile-commands.py for code analysis #1756

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Commits on Aug 15, 2023

  1. misc: Add gen-compile-commands.py for code analysis

    This patch adds gen-compile-commands.py script that generates
    compile_commands.json, which is a JSON Compilation Database Format
    Specification[1].
    
    This compile_commands.json can be used by static analysis tools such as
    clang-tidy[2] for advanced diagnosis or lintting.
    
    The usage is as follows.
    
      $ ./configure
    
      $ make clean    # To print build commands for all source files.
      $ ./misc/gen-compile-commands.py
      (... compile_commands.json generated ...)
    
      $ run-clang-tidy
    
    [1] https://clang.llvm.org/docs/JSONCompilationDatabase.html
    [2] https://clang.llvm.org/extra/clang-tidy
    Signed-off-by: Honggyu Kim <[email protected]>
    honggyukim committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    f4ab113 View commit details
    Browse the repository at this point in the history
  2. clang-tidy: Apply readability-non-const-parameter checker

    This patch applies automatic fixes by running the following clang-tidy
    command.
    
      $ run-clang-tidy -fix -checks='-*,readability-non-const-parameter'
    
    A few of manual modification are also applied to make const correctness.
    
    Link: https://clang.llvm.org/extra/clang-tidy/checks/readability/non-const-parameter.html
    Signed-off-by: Honggyu Kim <[email protected]>
    honggyukim committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    6ed2906 View commit details
    Browse the repository at this point in the history
  3. clang-tidy: Apply readability-isolate-declaration checker

    This patch applies automatic fixes by running the following clang-tidy
    command.
    
      $ run-clang-tidy -fix -checks='-*,readability-isolate-declaration'
    
    Link: https://clang.llvm.org/extra/clang-tidy/checks/readability/isolate-declaration.html
    Signed-off-by: Honggyu Kim <[email protected]>
    honggyukim committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    b503a05 View commit details
    Browse the repository at this point in the history
  4. clang-tidy: Apply readability-else-after-return checker

    This patch applies automatic fixes by running the following clang-tidy
    command.
    
      $ run-clang-tidy -fix -checks='-*,readability-else-after-return'
    
    Link: https://clang.llvm.org/extra/clang-tidy/checks/readability/else-after-return.html
    Signed-off-by: Honggyu Kim <[email protected]>
    honggyukim committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    0445998 View commit details
    Browse the repository at this point in the history
  5. clang-tidy: Apply readability-inconsistent-declaration-parameter-name…

    … checker
    
    This patch applies automatic fixes by a checker to catch inconsistent
    declaration parameter name by running the following command.
    
      $ run-clang-tidy -fix -checks='-*,readability-inconsistent-declaration-parameter-name'
    
    Link: https://clang.llvm.org/extra/clang-tidy/checks/readability/inconsistent-declaration-parameter-name.html
    Signed-off-by: Honggyu Kim <[email protected]>
    honggyukim committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    21916e1 View commit details
    Browse the repository at this point in the history
  6. clang-tidy: Apply readability-redundant-declaration checker

    This patch applies automatic fixes by running the following clang-tidy
    command.
    
      $ run-clang-tidy -fix -checks='-*,readability-redundant-declaration'
    
    Link: https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-declaration.html
    Signed-off-by: Honggyu Kim <[email protected]>
    honggyukim committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    7344cff View commit details
    Browse the repository at this point in the history
  7. clang-tidy: Apply bugprone-macro-parentheses checker

    This patch applies automatic fixes by running the following clang-tidy
    command.
    
      $ run-clang-tidy -fix -checks='-*,bugprone-macro-parentheses'
    
    Link: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/macro-parentheses.html
    Signed-off-by: Honggyu Kim <[email protected]>
    honggyukim committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    a0c5663 View commit details
    Browse the repository at this point in the history
  8. clang-tidy: Apply bugprone-suspicious-string-compare checker

    This patch applies automatic fixes by running the following clang-tidy
    command.
    
      $ run-clang-tidy -fix -checks='-*,bugprone-suspicious-string-compare'
    
    Link: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-string-compare.html
    Signed-off-by: Honggyu Kim <[email protected]>
    honggyukim committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    87aac06 View commit details
    Browse the repository at this point in the history