← 输入框|github.com|刷新
Skip to content

Anonymous namespaces opening bracket removed after using -fix #19

Open

Description

@PascalBoeschoten

I tried running run_O2CodeChecker.py with the -fix option on the ReadoutCard library (master branch).
This resulted in anonymous namespaces being broken by having their opening bracket removed.
For example, code like:

namespace {
 // some stuff in here
}

is turned into:

namespace
 // some stuff in here
}

The command I used was

run_O2CodeChecker.py -clang-tidy-binary `which O2codecheck` -checks=-*,modernize-*,-modernize-use-default,-modernize-pass-by-value,-modernize-use-auto,-modernize-use-bool-literals,-modernize-use-using,-modernize-loop-convert,-modernize-use-bool-literals,-modernize-make-unique,aliceO2-member-name,alice* -fix

Activity

  1. sawenzel commented on Sep 14, 2017

    @sawenzel
    Collaborator

    Thanks for this report.
    @ZdravkoD : Can you please take a look into this bug report?

    Please note that the namespace check is development is progress. Please disable it for the moment. The only checks in production are the ones listed in the o2checkcode.sh recipe.
    We might have to go to a real release model ... now that people are starting to use the checks -:)

  2. sawenzel commented on Sep 19, 2017

    @sawenzel
    Collaborator

    @PascalBoeschoten: I merged an improved namespace checker. Would you mind trying it out and seeing if the bug is solved?

  3. PascalBoeschoten commented on Sep 19, 2017

    @PascalBoeschoten
    Author

    If I run

    run_O2CodeChecker.py -clang-tidy-binary `which O2codecheck` -checks=-*,aliceO2-namespace-naming -fix
    

    it doesn't seem to find/change anything, even though my namespace names are camelcase. But it also doesn't break anonymous namespaces anymore.

  4. ZdravkoD commented on Sep 19, 2017

    @ZdravkoD
    Contributor

    @PascalBoeschoten Can you try running O2codecheck --list-checks --checks="alice*" and check if aliceO2-namespace-naming appears in the list? The command that you gave runs fine and finds namespace errors when I run it at ~/alice/sw/BUILD/O2-latest/O2/.

  5. PascalBoeschoten commented on Sep 19, 2017

    @PascalBoeschoten
    Author

    It appears in the list.
    The command I gave also lists only aliceO2-namespace-naming as check (others are all disabled)

    $> run_O2CodeChecker.py -clang-tidy-binary `which O2codecheck` -checks=-*,aliceO2-namespace-naming -fix
    Enabled checks:
        aliceO2-namespace-naming
    
  6. sawenzel commented on Sep 19, 2017

    @sawenzel
    Collaborator

    @PascalBoeschoten : Ok, I believe I know why this is: We recently needed to added filtering of the source path of the translation unit and we have probably put something with O2 ... not knowing that other repos want to use the tool as well. @ZdravkoD : We need to add configuration of the path from the outside.

  7. sawenzel commented on Sep 27, 2017

    @sawenzel
    Collaborator

    @PascalBoeschoten : We now added a configuration possibility to let the tool know which repository it is checking. Can you please add a .clang-tidy file inside your project as mentioned in this commit 642b8f4 and provide the proper regular expression matching your source tree.

    Feedback is highly welcome.

  8. sawenzel commented on Sep 27, 2017

    @sawenzel
    Collaborator

    @PascalBoeschoten : see also AliceO2Group/AliceO2#583; I checked that this works for O2 and the namespace checks.

  9. PascalBoeschoten commented on Sep 27, 2017

    @PascalBoeschoten
    Author

    So the file would contain something like this?

    CheckOptions:
      - key: CheckPathRegex
        value: '.*/ReadoutCard/.*'
    
  10. ZdravkoD commented on Sep 27, 2017

    @ZdravkoD
    Contributor

    @PascalBoeschoten : Yes, that should work if your files are located at a subfolder of ReadoutCard.

  11. PascalBoeschoten commented on Sep 29, 2017

    @PascalBoeschoten
    Author

    Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions