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 server mode status to -V option #10940

Merged
merged 1 commit into from Aug 22, 2022

Commits on Aug 22, 2022

  1. Add server mode status to -V option

    When YJIT (disabled by default) is enabled in Ruby, it is displayed as follows.
    
    ```console
    % ruby --yjit -ve 'RubyVM::YJIT.enabled?'
    ruby 3.2.0dev (2022-08-18T08:09:08Z master b0b9f7201a) +YJIT [x86_64-darwin19]
    ```
    
    `+YJIT` is added when YJIT is enabled.
    
    This is a change inspired by it. Below is before and after `rubocop -V`.
    
    ## Before
    
    ```console
    % rubocop -V
    1.35.0 (using Parser 3.1.2.1, rubocop-ast 1.21.0, running on ruby 3.2.0 x86_64-darwin19)
      - rubocop-performance 1.14.3
      - rubocop-rake 0.6.0
      - rubocop-rspec 2.11.1
    ```
    
    ## After
    
    It makes the `-V` format like `ruby --version`.
    
    ### No server mode
    
    The platform (`x86_64-darwin19`) display will change slightly.
    
    ```console
    % rubocop -V
    1.35.0 (using Parser 3.1.2.1, rubocop-ast 1.21.0, running on ruby 3.2.0) [x86_64-darwin19]
      - rubocop-performance 1.14.3
      - rubocop-rake 0.6.0
      - rubocop-rspec 2.11.1
    ```
    
    ### Server mode
    
    `+server` is added when server is enabled.
    
    ```console
    % rubocop -V
    1.35.0 (using Parser 3.1.2.1, rubocop-ast 1.21.0, running on ruby 3.2.0) +server [x86_64-darwin19]
      - rubocop-performance 1.14.3
      - rubocop-rake 0.6.0
      - rubocop-rspec 2.11.1
    ```
    
    This change has the following benefits:
    
    - Shorthand alternative to `rubocop --server-status`
    - We can check the enable or disable of server mode in the bug report template
    koic committed Aug 22, 2022
    Copy the full SHA
    e32e49c View commit details
    Browse the repository at this point in the history