<commit_before>#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by NotSqrt
# Copyright (c) 2013 NotSqrt
#
# License: MIT
#

"""
This module exports the Shellcheck plugin class.

Example output with --format gcc

-:230:7: warning: Quote this to prevent word splitting. [SC2046]
-:230:7: note: Useless echo? Instead of 'echo $(cmd)', just use 'cmd'. [SC2005]
-:230:158: note: Double quote to prevent globbing and word splitting. [SC2086]
-:234:10: error: Add double quotes around ${VAR[@]}, otherwise it's just like $* and breaks on spaces. [SC2068]

"""

from SublimeLinter.lint import Linter


class Shellcheck(Linter):
    """Provides an interface to shellcheck."""

    syntax = 'shell-unix-generic'
    cmd = 'shellcheck --format gcc -'
    regex = (
        r'^.+?:(?P<line>\d+):(?P<col>\d+): '
        r'(?:(?P<error>error)|(?P<warning>(warning|note))): '
        r'(?P<message>.+)$'
    )

    defaults = {
        '--exclude=,': ''
    }<commit_msg>Handle new sublime syntax: bash<commit_after>#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by NotSqrt
# Copyright (c) 2013 NotSqrt
#
# License: MIT
#

"""
This module exports the Shellcheck plugin class.

Example output with --format gcc

-:230:7: warning: Quote this to prevent word splitting. [SC2046]
-:230:7: note: Useless echo? Instead of 'echo $(cmd)', just use 'cmd'. [SC2005]
-:230:158: note: Double quote to prevent globbing and word splitting. [SC2086]
-:234:10: error: Add double quotes around ${VAR[@]}, otherwise it's just like $* and breaks on spaces. [SC2068]

"""

from SublimeLinter.lint import Linter


class Shellcheck(Linter):
    """Provides an interface to shellcheck."""

    syntax = ('shell-unix-generic', 'bash')
    cmd = 'shellcheck --format gcc -'
    regex = (
        r'^.+?:(?P<line>\d+):(?P<col>\d+): '
        r'(?:(?P<error>error)|(?P<warning>(warning|note))): '
        r'(?P<message>.+)$'
    )

    defaults = {
        '--exclude=,': ''
    }
{'fraction_non_alphanumeric': 0.16748285994123407, 'fraction_numerical': 0.040156709108716944, 'mean_word_length': 3.560267857142857, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1710991', 'n_tokens_mistral': 777, 'n_tokens_neox': 696, 'n_words': 215}