<commit_before>/* CodeNarc RuleSet
   http://codenarc.sourceforge.net/codenarc-rule-index.html */

ruleset {
    description 'MIST Groovy RuleSet'

    /* class name starts with a uppercase letter */
    ClassName {
        description = 'Verify that class name starts with an uppercase letter followed by zero or ' +
                      'more word characters or dollar signs, warning if skeleton code is unchanged.'
        regex = '''(?x)
                   ^(
                     (?!(SkeletonApplication|Sample|SampleResource)$) # fail on skeleton class names
                     ([A-Z]\\w*$?)*                                   # codenarc default
                   )$'''
        priority = 3
    }

    /* variable name starts with a lowercase letter */
    VariableName {
        description = 'Verify that class name starts with an lowercase letter followed by zero or ' +
                'more word characters or dollar signs, warning if skeleton code is unchanged.'
        regex = '''(?x)
                   ^(
                     ([a-z]\\w*$?)*
                   )$'''
        priority = 3
    }

    /* method name starts with a lowercase letter */
    MethodName

    PackageName {
        description = 'Verify that package name begins with \'edu.oregonstate.mist.\' and consists ' +
                      'only of lowercase letters and numbers separated by periods, warning if ' +
                      'skeleton code is unchanged.'
        regex = '''(?x)
                   ^(
                     edu\\.oregonstate\\.mist # begin with edu.oregonstate.mist
                     (?!\\.webapiskeleton)    # fail on skeleton package name
                     (\\.[a-z0-9]+)*          # periods separate lowercase alphanumeric package names
                   )$'''
        packageNameRequired = true
        priority = 3
    }

    /* package name consists only of lowercase letters and numbers, separated
       by periods */
    PackageName

    /* semicolons as line terminators are not required in Groovy */
    UnnecessarySemicolon

    /* If a statement is the last line in a method or closure then you do not need to have the return keyword. */
    UnnecessaryReturnKeyword

    /* Checks that if statements use braces, even for a single statement. */
    IfStatementBraces

    /* Checks that else blocks use braces, even for a single statement. */
    ElseBlockBraces

    /* Checks that for statements use braces, even for a single statement. */
    ForStatementBraces

    /* Checks that while statements use braces, even for a single statement. */
    WhileStatementBraces

    /* Makes sure there are no consecutive lines that are either blank or whitespace only. */
    ConsecutiveBlankLines

    /* Check that there is at least one space before each opening brace */
    SpaceBeforeOpeningBrace

    /* Check that there is at least one space after each closing brace */
    SpaceAfterClosingBrace

    /* Checks the maximum length for each line of source code. Defaults is 120 characters maximum. */
    LineLength {
        description = 'Checks for number of characters, so lines that include tabs may not ' +
                      'exceed 120 characters.'
        length = 120

        priority = 3
    }
}<commit_msg>Use 100 characters instead of 120<commit_after>/* CodeNarc RuleSet
   http://codenarc.sourceforge.net/codenarc-rule-index.html */

ruleset {
    description 'MIST Groovy RuleSet'

    /* class name starts with a uppercase letter */
    ClassName {
        description = 'Verify that class name starts with an uppercase letter followed by zero or ' +
                      'more word characters or dollar signs, warning if skeleton code is unchanged.'
        regex = '''(?x)
                   ^(
                     (?!(SkeletonApplication|Sample|SampleResource)$) # fail on skeleton class names
                     ([A-Z]\\w*$?)*                                   # codenarc default
                   )$'''
        priority = 3
    }

    /* variable name starts with a lowercase letter */
    VariableName {
        description = 'Verify that class name starts with an lowercase letter followed by zero or ' +
                'more word characters or dollar signs, warning if skeleton code is unchanged.'
        regex = '''(?x)
                   ^(
                     ([a-z]\\w*$?)*
                   )$'''
        priority = 3
    }

    /* method name starts with a lowercase letter */
    MethodName

    PackageName {
        description = 'Verify that package name begins with \'edu.oregonstate.mist.\' and consists ' +
                      'only of lowercase letters and numbers separated by periods, warning if ' +
                      'skeleton code is unchanged.'
        regex = '''(?x)
                   ^(
                     edu\\.oregonstate\\.mist # begin with edu.oregonstate.mist
                     (?!\\.webapiskeleton)    # fail on skeleton package name
                     (\\.[a-z0-9]+)*          # periods separate lowercase alphanumeric package names
                   )$'''
        packageNameRequired = true
        priority = 3
    }

    /* package name consists only of lowercase letters and numbers, separated
       by periods */
    PackageName

    /* semicolons as line terminators are not required in Groovy */
    UnnecessarySemicolon

    /* If a statement is the last line in a method or closure then you do not need to have the return keyword. */
    UnnecessaryReturnKeyword

    /* Checks that if statements use braces, even for a single statement. */
    IfStatementBraces

    /* Checks that else blocks use braces, even for a single statement. */
    ElseBlockBraces

    /* Checks that for statements use braces, even for a single statement. */
    ForStatementBraces

    /* Checks that while statements use braces, even for a single statement. */
    WhileStatementBraces

    /* Makes sure there are no consecutive lines that are either blank or whitespace only. */
    ConsecutiveBlankLines

    /* Check that there is at least one space before each opening brace */
    SpaceBeforeOpeningBrace

    /* Check that there is at least one space after each closing brace */
    SpaceAfterClosingBrace

    /* Checks the maximum length for each line of source code. Defaults is 120 characters maximum. */
    LineLength {
        description = 'Checks for number of characters, so lines that include tabs may not ' +
                      'exceed 100 characters.'
        length = 100

        priority = 3
    }
}
{'fraction_non_alphanumeric': 0.0762400489895897, 'fraction_numerical': 0.005511328842620943, 'mean_word_length': 1.885600706713781, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3286561', 'n_tokens_mistral': 1686, 'n_tokens_neox': 1522, 'n_words': 651}