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

Add shorthand -f for format option. #273

Merged

Conversation

soartec-lab
Copy link

@soartec-lab soartec-lab commented Aug 21, 2022

Hi. This is a small improvement.

Implemented -f, an option shorthand for specifying the result format when executing cli.
There is a description in the README, but it was not actually implemented.

https://github.com/Shopify/erb-lint#output-formats

Result

$ ./exe/erblint -h
Usage: erblint [options] [file1, file2, ...]
        --config FILENAME            Config file [default: .erb-lint.yml]
    -f, --format FORMAT              Report offenses in the given format: (compact, json, multiline) (default: multiline)
        --lint-all                   Lint all files matching configured glob [default: **/*.html{+*,}.erb]
        --enable-all-linters         Enable all known linters
        --enable-linters LINTER[,LINTER,...]
                                     Only use specified linter
                                     Known linters are: allowed_script_type, closing_erb_tag_indent, deprecated_classes, erb_safety, extra_newline, final_newline, hard_coded_string, no_javascript_tag_helper, parser_errors, partial_instance_variable, require_input_autocomplete, require_script_nonce, right_trim, rubocop, rubocop_text, self_closing_tag, space_around_erb_tag, space_in_html_tag, space_indentation, trailing_whitespace
        --fail-level SEVERITY        Minimum severity for exit with error code
    -a, --autocorrect                Correct offenses automatically if possible (default: false)
        --allow-no-files             When no matching files found, exit successfully (default: false)
    -s, --stdin FILE                 Pipe source from STDIN. Takes the path to be used to check which rules to apply.
    -h, --help                       Show this message
        --version                    Show version

$ ./exe/erblint ./ -f compact
.erb-lint.yml not found: using default config
no files found...

Copy link
Member

@etiennebarrie etiennebarrie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@etiennebarrie etiennebarrie merged commit 19c9ddb into Shopify:main Aug 22, 2022
@shopify-shipit shopify-shipit bot temporarily deployed to production November 1, 2022 16:01 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants