Provides integration with RuboCop to lint your Ruby source files.
- Automatically invokes RuboCop and reports on issues found within your Ruby source files.
RuboCop Extension for Panic's Nova Code Editor
License: MIT License
Would it makes sense to optionally support standardrb as linter (based on rubocop)?
The script uses
RuboCop[21:51:48.314000] Found RuboCop 0.80.0 (Bundled)
but it marks offenses that:
bundle exec rubocop
ignores those offenses.
Thanks for fixing bundler :)
However, the extension still doesn't work for me:
RuboCop[19:37:35.502000] Found RuboCop 0.51.0 (Bundled)
RuboCop[19:37:37.847000] invalid option: --no-display-cop-names
/Users/msapka/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/rubocop-0.51.0/lib/rubocop/options.rb:19:in `parse'
/Users/msapka/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/rubocop-0.51.0/lib/rubocop/cli.rb:27:in `run'
/Users/msapka/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/rubocop-0.51.0/bin/rubocop:13:in `block in <top (required)>'
/Users/msapka/.rbenv/versions/2.3.8/lib/ruby/2.3.0/benchmark.rb:308:in `realtime'
/Users/msapka/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/rubocop-0.51.0/bin/rubocop:12:in `<top (required)>'
/Users/msapka/.rbenv/versions/2.3.8/bin/rubocop:22:in `load'
/Users/msapka/.rbenv/versions/2.3.8/bin/rubocop:22:in `<main>'
I'm 99% sure that this means Rubocop we are using is too old for this fancy option.
I am able to run bundle exec rubocop
in my project without issues, but in Nova, I keep getting "Error: unrecognized cop or department" errors. I am on Rails 7, Ruby 3.1.4, and these are the rubocop gems I have included:
group :development, :test do
gem 'rubocop'
gem 'rubocop-performance'
gem 'rubocop-rails'
gem 'rubocop-rspec'
Would there be any possibility of respecting
.rubycop.yml
files in subfolders? It seems like the extension is only reading config files in the root of the project, which isn't how our team works.
Originally posted by @gregawoods in #3 (comment)
An option to auto-format a file on save is what I really want from this extension. Is anyone working on this already, or should I get started on it?
For implementation, I'm okay with this being the default setting, but it does make sense for it to be toggle-able.
I’m seeing an error that says:
RuboCop Not Found
The "rubocop" command could not be found in your environment.
Relevant details:
Gemfile
. Rubocop is not installed globally.rubocop
and bundle exec rubocop
work.I read the Help guide for the extension. I wish I could have debugged it further on my end before creating this issue, but I’m not sure exactly what the best next steps to take are.
❤️ Thank you so much for making this extension! ❤️
First, thank you so much for writing this and if I can help test, I am happy to.
I am seeing errors reported for files that should be excluded in the .rubocop.yml
file. I ran into this before with other tools and I believe the solution was to add the --force-exclusion
when running rubocop
.
Might that be an option? Or even the default?
Well, it was working for awhile but it suddenly stopped. In the extensions console, I see this:
RuboCop[10:15:45.408000] Found RuboCop 0.80.1 (Global)
RuboCop[10:15:45.415000] env: rubocop: No such file or directory
... and that's it - nothing is showing in the editor even when I make a known error.
I've been using RuboCop long enough to know that sometimes it breaks with all the different versions of Ruby, etc... But this info above is not enough to debug.
I can't tell which Ruby it's using (I use RVM) or why it's failing. When I run from the command line, RuboCop works fine, is in the Gemfile, installed, etc...
Is it possible for the extension to do what other extensions in editors like Sublime do and print out all of the details about what they are running so that errors are debuggable?
https://novadocs.panic.com/api-reference/file-system-watcher/
I'd love if fixing the issues from terminal (rubocop -a
) would be visible in the editor.
Hey there,
my situation is the following:
rubocop
installed globally and running rubocop --format=json
works in my project-root.Gemfile
in my project-root containing rubocop
, but running bundle exec rubocop
will not work because the project is run using docker.I get the following exception when trying to use the extension:
RuboCop[13:03:34.174000] SyntaxError: JSON Parse error: Unrecognized token '#'
RuboCop[13:03:34.174000] Extension encountered an uncaught exception:
/Users/tim/Library/Application Support/Nova/Extensions/Mecham.RuboCop/Scripts/main.dist.js (Line 282, Column 0)
TypeError: undefined is not an object (evaluating 'offenses.map')
file:///Users/tim/Library/Application%20Support/Nova/Extensions/Mecham.RuboCop/Scripts/main.dist.js:282:42
handleOutput@file:///Users/tim/Library/Application%20Support/Nova/Extensions/Mecham.RuboCop/Scripts/main.dist.js:211:37
file:///Users/tim/Library/Application%20Support/Nova/Extensions/Mecham.RuboCop/Scripts/main.dist.js:170:76
Anything I can do to resolve this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.