• Sign In



  • Categories

    Extension Details



    Readme

    RuboCop Extension for Nova

    Provides integration with RuboCop to lint (and optionally, fix) your Ruby source
    files.

    Features

    • Automatically invokes RuboCop and reports on issues found within your Ruby
      source files.

    Release Notes

    Version 0.6.0

    • Fixed the display of offenses in files due to referencing those files by the
      incorrect location format.
    • Updated all development dependencies to their latest versions.

    Version 0.5.2

    • Improved parsing of command output by detecting and parsing only the JSON
      output from the RuboCop command (thanks @toadle).

    Version 0.5.1

    • Fixed an issue where inclusion/exclusion paths were not being honored in the
      RuboCop configuration (thanks @jbeker).
    • Updated deprecated extension metadata for Nova 1.0.

    Version 0.5.0

    • Added notifications of RuboCop invocation errors.
    • Added a listener to also run RuboCop before save.
    • Added better error handling when running the rubocop command so that we
      don't completely blow up when there are configuration warnings and errors.

    Version 0.4.2

    • Fixed invocation of bundled RuboCop by executing it in the full shell
      environment.

    Version 0.4.1

    • Fixed build output for 0.4.0 and resubmitted to the Nova Extension Library.

    Version 0.4.0

    • Fixed bundled RuboCop check due to a typo (thanks @evanleck).
    • Added gems.rb as an alternative to Gemfile when checking for a bundled
      RuboCop in the project (thanks @evanleck).

    Version 0.3.1

    • Improved the speed of executing RuboCop by caching the environment checks
      that determine which RuboCop installation to use.
    • Reverted change from 0.2.2 that configured RuboCop to omit cop names from
      its output. They will be stripped manually for compatibility with older
      versions of RuboCop.

    Version 0.3.0

    • Added documentation describing how we attempt to locate and run RuboCop in
      the current project environment.
    • Added support for detecting and executing RuboCop with Bundler.

    Version 0.2.2

    • Updated error notification to direct users to the extension preferences when
      RuboCop could not be found.
    • Configured RuboCop to omit cop names from returned messages (the names were
      previously being stripped manually during parsing).

    Version 0.2.1

    • Fixed behavior based on the rubocop exit code.
    • Stopped outputting the raw RuboCop JSON result to the console.

    Version 0.2.0

    • Added an informative notice to the user when RuboCop could not be found.
    • Restructured the project to allow for npm dependencies to be consumed.
    • Added a new icon for the extension.
    • Added documentation to the README.
    • Simplified the formatting of the CHANGELOG.

    Version 0.1.0

    • Initial release.

    License

    MIT License

    Copyright (c) 2019-2022 Justin Mecham

    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all
    copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    SOFTWARE.

    Help

    Setting Up Your Environment

    This extension will attempt to locate RuboCop in your local environment in the
    following order:

    1. If your project has a Gemfile at the root of the workspace, the extension
      will attempt to run bundle exec rubocop in the case you have your RuboCop
      installation managed by Bundler.

    2. If your project is not using Bundler to manage your RuboCop installation,
      the extension will attempt to run rubocop for your current project's shell
      environment.

    Managing RuboCop Installation with Bundler

    If you would like to manage your RuboCop installation with Bundler, please
    reference the relevant section of the
    RuboCop Installation Instructions.

    Installing RuboCop Globally

    The preferred way to run Ruby on macOS is through a version manager, such as
    Rbenv or RVM. When running this extension, we will attempt to find RuboCop in
    your current shell environment for the current workspace (i.e. if you have
    Rbenv or RVM configured for your shell, the extension should detect it for the
    currently managed Ruby version).

    If you are not using a Ruby version manager, you may still install RuboCop
    globally on macOS Catalina and below with sudo gem install rubocop.