Skip to content

Maybe port all of the terrible c++ linters I've written in the past #21

Closed

Description

@asottile
No description provided.

Activity

  1. asottile commented on Jun 15, 2014

    @asottile
    MemberAuthor

    Most of these are grep based. I took a stab a quick stab at a few of them:

    -   id: space-after-keywords
        name: Space after keywords
        language: system
        entry: grep -E -H -n '^[ ]*(if|for|while|catch)\('
        files: \.(c|cc|cpp|h|hpp)$
        expected_return_value: 123
    -   id: space-after-comments
        name: Space after comments
        language: system
        entry: grep -E -H -n '(^| )//[^ ]'
        files: \.(cc|cpp|h|hpp)$
        expected_return_value: 123
    -   id: space-brace
        name: Space between paren and brace
        language: system
        entry: grep -H -n '){{'
        files: \.(c|cc|cpp|h|hpp)$
        expected_return_value: 123
    -   id: space-after-paren
        name: No spaces after parens
        language: system
        entry: grep -E -H -n '\( '
        files: \.(c|cc|cpp|h|hpp)$
        expected_return_value: 123
    -   id: include-space
        name: 'Needs space after #include'
        language: system
        entry: grep -E -H -n '^[ ]*#include[^ ]'
        files: \.(c|cc|cpp|h|hpp)$
        expected_return_value: 123
  2. asottile commented on Jun 17, 2014

    @asottile
    MemberAuthor

    The above hooks don't actually work (I added a testcase demonstrating their problem to the pcre branch #120 . I'll rewrite these as pcre hooks later.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions