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

Show extension cop versions when using --verbose-version option #8908

Merged

Commits on Oct 20, 2020

  1. Show extension cop versions when using --verbose-version option

    ## Summary
    
    This PR shows extension cop versions when using `--verbose-version` option.
    
    Before:
    
    ```console
    % rubocop -V
    0.93.1 (using Parser 2.7.2.0, rubocop-ast 0.8.0, running on ruby 2.7.2 x86_64-darwin19)
    ```
    
    After:
    
    ```console
    % rubocop -V
    0.93.1 (using Parser 2.7.2.0, rubocop-ast 0.8.0, running on ruby 2.7.2 x86_64-darwin19)
      - rubocop-performance 1.8.1
      - rubocop-rspec 1.43.2
    ```
    
    This information is not shown in `rubocop -v` as it is needed in the bug report, first.
    
    ## More Information
    
    It shows extension cop versions named rubocop-feature (e.g. rubocop-performance, rubocop-rspec).
    Extention names separated by two or more, such as rubocop-feature-foo, are not
    supported by this PR. First of all, this is aimed at supporting the extension cop managed
    by RuboCop Headquarters.
    
    This feature searches for version constant in two ways:
    
    - RuboCop core version style (e.g. `RuboCop::Performance::Version::STRING`)
    - `bundle gem` version style (e.g. `RuboCop::Rake::VERSION`)
    
    This enriches the information when reporting bugs from users.
    
    It was inspired by RSpec. Thank you.
    
    ```console
    % bundle exec rspec --version
    RSpec 3.9
      - rspec-core 3.9.3
      - rspec-expectations 3.9.2
      - rspec-mocks 3.9.1
      - rspec-support 3.9.3
    ```
    koic committed Oct 20, 2020
    Copy the full SHA
    96d2809 View commit details
    Browse the repository at this point in the history