Code Monkey home page Code Monkey logo

codeclimate-haml-lint's People

Contributors

andyw8 avatar dblandin avatar dependabot[bot] avatar jewilmeer avatar michaelherold avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

codeclimate-haml-lint's Issues

Severity Levels

I got an email from Code Climate with an alarming title: 1 new severe issue found

So I opened it:

Inconsistent indentation: 2 spaces used for indentation

๐Ÿ˜

I see the current mapping is:

HAML_LINT_TO_CODE_CLIMATE = {
  error: "critical",
  warning: "normal",
}

As haml-lint doesn't deal with security issues, I think it's difficult to justify anything being at the "critical" or "blocker" level. Even "major" seems too strong.

How about this:

HAML_LINT_TO_CODE_CLIMATE = {
  error: "minor",
  warning: "info",
}

(Sidenote: Is "normal" valid? It's not listed in the spec)

Possible conflict with rubocop-rspec?

% codeclimate analyze -e haml_lint --dev
Starting analysis
Running haml_lint: Done!
error: (CC::Analyzer::Engine::EngineFailure) engine haml_lint:stable failed with status 1 and stderr
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require': cannot load such file -- rubocop-rspec (LoadError)
	from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require'
	from /usr/local/bundle/gems/rubocop-0.47.1/lib/rubocop/config_loader_resolver.rb:15:in `block in resolve_requires'
	from /usr/local/bundle/gems/rubocop-0.47.1/lib/rubocop/config_loader_resolver.rb:11:in `each'
	from /usr/local/bundle/gems/rubocop-0.47.1/lib/rubocop/config_loader_resolver.rb:11:in `resolve_requires'
	from /usr/local/bundle/gems/rubocop-0.47.1/lib/rubocop/config_loader.rb:37:in `load_file'
	from /usr/local/bundle/gems/rubocop-0.47.1/lib/rubocop/config_loader.rb:107:in `configuration_from_file'
	from /usr/local/bundle/gems/rubocop-0.47.1/lib/rubocop/config_store.rb:44:in `for'
	from /usr/local/bundle/gems/rubocop-0.47.1/lib/rubocop/runner.rb:163:in `cached_run?'
	from /usr/local/bundle/gems/rubocop-0.47.1/lib/rubocop/runner.rb:59:in `ensure in inspect_files'
	from /usr/local/bundle/gems/rubocop-0.47.1/lib/rubocop/runner.rb:61:in `inspect_files'
	from /usr/local/bundle/gems/rubocop-0.47.1/lib/rubocop/runner.rb:36:in `run'
	from /usr/local/bundle/gems/rubocop-0.47.1/lib/rubocop/cli.rb:72:in `execute_runner'
	from /usr/local/bundle/gems/rubocop-0.47.1/lib/rubocop/cli.rb:27:in `run'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/linter/rubocop.rb:42:in `lint_file'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/linter/rubocop.rb:32:in `block in find_lints'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/linter/rubocop.rb:81:in `with_ruby_from_stdin'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/linter/rubocop.rb:31:in `find_lints'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/linter/rubocop.rb:15:in `visit_root'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/haml_visitor.rb:40:in `safe_send'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/haml_visitor.rb:19:in `visit'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/linter.rb:28:in `run'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/runner.rb:84:in `block in collect_lints'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/runner.rb:83:in `map'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/runner.rb:83:in `collect_lints'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/runner.rb:119:in `process_file'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/runner.rb:108:in `block in process_files'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/runner.rb:107:in `each'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/runner.rb:107:in `process_files'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/runner.rb:132:in `report'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/runner.rb:23:in `run'
	from /usr/src/app/lib/cc/engine/source_file.rb:64:in `process'
	from /usr/src/app/lib/cc/engine/haml_lint.rb:54:in `block in run'
	from /usr/src/app/lib/cc/engine/haml_lint.rb:48:in `run'
	from /usr/src/app/bin/codeclimate-haml_lint:10:in `<main>'

My .rubocop.yml has this on the first line:

require: rubocop-rspec

Failure with rubocop-performance

In RuboCop 0.68, the performance cops were moved out to a separate gem, so to use them I have added this to my RuboCop config:

require: rubocop-performance

This fails because the rubocop-performance gem is not part of the engine.

Integrate Mry into the Rubocop runner

I recently discovered Mry, a tool that migrates your Rubocop config between versions. I noticed that the Rubocop engine uses a freedom patch to integrate Mry with Rubocop's configuration runner.

I think it would be best to do the same in this engine since there is so much churn in Rubocop's cop configuration.

undefined method `match' in `multiline_pipe.rb`

Hi @michaelherold

Thanks for the fix in #1. Re-running, I ran into this:

/usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/linter/multiline_pipe.rb:42:in `check': undefined method `match' for nil:NilClass (NoMethodError)
Did you mean?  catch
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/linter/multiline_pipe.rb:20:in `visit_silent_script'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/haml_visitor.rb:40:in `safe_send'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/haml_visitor.rb:19:in `visit'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/haml_visitor.rb:30:in `block in visit_children'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/haml_visitor.rb:30:in `each'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/haml_visitor.rb:30:in `visit_children'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/haml_visitor.rb:24:in `visit'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/linter.rb:28:in `run'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/runner.rb:84:in `block in collect_lints'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/runner.rb:83:in `map'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/runner.rb:83:in `collect_lints'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/runner.rb:119:in `process_file'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/runner.rb:108:in `block in process_files'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/runner.rb:107:in `each'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/runner.rb:107:in `process_files'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/runner.rb:132:in `report'
	from /usr/local/bundle/gems/haml_lint-0.23.1/lib/haml_lint/runner.rb:23:in `run'
	from /usr/src/app/lib/cc/engine/source_file.rb:64:in `process'
	from /usr/src/app/lib/cc/engine/haml_lint.rb:54:in `block in run'
	from /usr/src/app/lib/cc/engine/haml_lint.rb:48:in `run'
	from /usr/src/app/bin/codeclimate-haml_lint:10:in `<main>'

Let me know there any other information I can provide which might help.

Support Ruby 2.5

I get an error when TargetRubyVersion is set to 2.5 in the Rubocop config.

In .rubocop.yml:

AllCops:
  TargetRubyVersion: 2.5

Output from engine run in debug mode:

D, [2018-06-29T19:05:57.382790 #1] DEBUG -- : engine stderr: Error: Unknown Ruby version 2.5 found in `TargetRubyVersion` parameter (in .rubocop.yml).
D, [2018-06-29T19:05:57.382922 #1] DEBUG -- : engine stderr: Supported versions: 2.1, 2.2, 2.3, 2.4

I assume this has something to do with the hard-coded Ruby version in the Dockerfile. Would it be possible to upgrade or make this configurable?

Thanks for your work on this engine! It will be very useful to our team once we are able to run it on our project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.