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 --init option to rubocop command #6928

Merged
merged 1 commit into from Apr 14, 2019

Commits on Apr 13, 2019

  1. Add --init option to rubocop command

    This PR adds `--init` option to `rubocop` command.
    
    ```console
    % mkdir example
    % cd /tmp/example
    % rubocop --init
    Writing new .rubocop.yml to /private/tmp/example/.rubocop.yml
    % cat .rubocop.yml
    # The behavior of RuboCop can be controlled via the .rubocop.yml
    # configuration file. It makes it possible to enable/disable
    # certain cops (checks) and to alter their behavior if they accept
    # any parameters. The file can be placed either in your home
    # directory or in some project directory.
    #
    # RuboCop will start looking for the configuration file in the directory
    # where the inspected file is and continue its way up to the root directory.
    #
    # See https://github.com/rubocop-hq/rubocop/blob/master/manual/configuration.md
    % rubocop --init # A warning will occur when .rubocop.yml already exists
    .rubocop.yml already exists at /private/tmp/example/.rubocop.yml
    ```
    
    It may be good to add a simple commented examples of basic configuration in the future.
    
    First of all, this PR aims to generate .rubocop.yml which contains the following configuration URL.
    https://github.com/rubocop-hq/rubocop/blob/master/manual/configuration.md
    
    And the generated .rubocop.yml text is quoted from the above URL.
    koic committed Apr 13, 2019
    Copy the full SHA
    6cc672d View commit details
    Browse the repository at this point in the history