Code Monkey home page Code Monkey logo

coffeelint-ruby's Introduction

Oh, Hello! I'm Zoey!

I make things. Sometimes.

coffeelint-ruby's People

Contributors

alisnic avatar jmnsf avatar joker-777 avatar jonseaberg avatar josh avatar krzyczak avatar mattwhite avatar maxjacobson avatar mlarraz avatar msalzburg avatar mwean avatar nwtn avatar rodovich avatar zmbush avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

coffeelint-ruby's Issues

Coffeelint::run_test_suite indicates success when tests are failing

I noticed my coffeelint rake task wasn't failing anymore when tests were failing. It looks like Coffeelint::display_test_results is always returning true now.

results = Coffeelint.lint "hey: ->\n  @bort()\n", :missing_fat_arrows => { :level => "error" }
Coffeelint.display_test_results 'Such failure', results
=> true

Execution is slow

Hi there,

I was wondering if there is a reason that coffeelint is run a file at a time? Running coffeelint directly from the command line on all out files take 2 seconds but running it via coffeelint-ruby takes 47 seconds.

Is it not possible to simply pass the directory through to coffeelint?

Peter

TypeError: undefined is not an object when using transforms

I'm experiencing a problem where I can run coffeelint from npm (verison 1.9.1) and I'm able to use the transforms feature, which converts some files to coffeescript prior to linting, but when I do it with coffeelint.rb at the command line or through a Rake task (using the bundled coffeelint 1.9.1 code), I get this error:

$ coffeelint.rb -f config/coffeelint.json app/assets/javascripts/components/page.coffee.cjsx

lint@(execjs):281:29: TypeError: undefined is not an object (evaluating 'ruleLoader.require') (ExecJS::ProgramError)
        from (execjs):2786:12
        from (execjs):2790:21
        from (execjs):1:46
        from global code@(execjs):1:58
        from /Users/geoff/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/execjs-2.4.0/lib/execjs/external_runtime.rb:32:in `exec'
        from /Users/geoff/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/execjs-2.4.0/lib/execjs/external_runtime.rb:21:in `eval'
        from /Users/geoff/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/execjs-2.4.0/lib/execjs/external_runtime.rb:39:in `call'
        from /Users/geoff/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/coffeelint-1.9.1/lib/coffeelint.rb:49:in `lint'
        from /Users/geoff/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/coffeelint-1.9.1/lib/coffeelint.rb:53:in `lint_file'
        from /Users/geoff/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/coffeelint-1.9.1/lib/coffeelint.rb:104:in `run_test'
        from /Users/geoff/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/coffeelint-1.9.1/lib/coffeelint/cmd.rb:86:in `block in main'
        from /Users/geoff/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/coffeelint-1.9.1/lib/coffeelint/cmd.rb:82:in `each'
        from /Users/geoff/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/coffeelint-1.9.1/lib/coffeelint/cmd.rb:82:in `main'
        from /Users/geoff/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/coffeelint-1.9.1/bin/coffeelint.rb:5:in `<top (required)>'
        from /Users/geoff/.rbenv/versions/2.2.1/bin/coffeelint.rb:23:in `load'
        from /Users/geoff/.rbenv/versions/2.2.1/bin/coffeelint.rb:23:in `<main>'

I get a similar issue if I specify the coffeelint.js file installed through npm, but I don't get the issue if I run my tests through the coffeelint executable that comes from npm. I'm trying to figure out if there's either something straightforward that I'm missing or if there's a way to allow the gem to use coffeelint with other npm packages to integrate transforms.

coffeelint rake task exits early as of 1.10.0

https://github.com/zmbush/coffeelint-ruby/blob/master/lib/tasks/coffeelint.rake#L3
The rake task calls Coffeelint.run_test_suite on app and spec.
success = Coffeelint.run_test_suite('app') and Coffeelint.run_test_suite('spec')

The new implementation of Coffeelint.run_test_suite exits with the number of failures. This causes the rake task to exit after running Coffeelint.run_test_suite('app'). Is there a reason to exit in run_test_suite? I can make the changes. Just wondering how you would like to structure the code. Another method to run the test suite that can be used by run_test_suite and the rake task, or to remove the exit from run_test_suite, or another option?

any way to hook into coffeelint's config.json support?

Thanks for this gem - it's really helping our code quality!

I'm wondering if there's a way to get coffeelint to load a config file? I think all that is handled by coffeelint's commandline.coffee, but it looks like you're invoking coffeelint.coffee directly, so it might not be an easy addition?

Possible submodule problem

When using the Ruby Gem > 0.0.6 I get this error: No such file or directory - /Users/user/.rvm/gems/ruby-2.0.0-p247@gemset/gems/coffeelint-0.1.1/coffeelint/src/coffeelint.coffee

It doesn't happen when using gem 'coffeelint', :git => 'git://github.com/zipcodeman/coffeelint-ruby.git', :submodules => true so I'm guessing the submodule isn't loaded with the Ruby Gem.

Possible side-effect of f1ef116?

Some coffeelint config options are ignored by coffeelint-ruby

I've got a custom coffeelint.json that gives more errors/warns when I run

coffeelint -f lib/tasks/coffeelint.json .

than when I run a raketask using coffeelint-ruby and the config file.

    Coffeelint.lint "hey: ->\n  @bort()\n", missing_fat_arrows: { level: 'error' }

and

    Coffeelint.lint "hey: =>\n  bort()\n", no_unnecessary_fat_arrows: { level: 'error' }

both give no errors.

The cyclomatic complexity rule is also being ignored.

Rake task "coffeelint" not found for Rails 5.0.0

For this project, we're using coffeelint as part of our CI chain:

https://github.com/braingourmets/gethdo

With Rails 4.2.7, the coffeelint tasks gets executed when running the default Rake task:

klee@gonzales:~/src/ruby/gethdo$ bin/rake
Running via Spring preloader in process 31536
...
  โœ“ app/assets/javascripts/home.js.coffee
...

However, the coffee_lint task is not listed among the available Rake tasks:

klee@gonzales:~/src/ruby/gethdo$ bin/rake -T
Running via Spring preloader in process 31761
...
rake bundle_audit:run                   # Update vulnerabilities database and check gems using bundle-audit
rake bundle_audit:update                # Update bundle-audit database
rake cache_digests:dependencies         # Lookup first-level dependencies for TEMPLATE (like messages/show or comments/_comment.html)
rake cache_digests:nested_dependencies  # Lookup nested dependencies for TEMPLATE (like messages/show or comments/_comment.html)
rake db:create                          # Creates the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use db:create:all to create all databases in...
rake db:drop                            # Drops the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use db:drop:all to drop all databases in the c...
rake db:fixtures:load                   # Load fixtures into the current environment's database

Now, when we upgrade to Rails 5.0.0 and run the default Rake task, coffee_lint crashes:

LoadError: cannot load such file -- /home/klee/src/ruby/gethdo/test
/home/klee/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:293:in `require'
/home/klee/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:293:in `block in require'
/home/klee/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:259:in `load_dependency'
/home/klee/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:293:in `require'
/home/klee/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0/lib/rails/test_unit/test_requirer.rb:11:in `block in require_files'
/home/klee/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0/lib/rails/test_unit/test_requirer.rb:10:in `each'
/home/klee/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0/lib/rails/test_unit/test_requirer.rb:10:in `require_files'
/home/klee/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0/lib/rails/test_unit/minitest_plugin.rb:76:in `plugin_rails_init'
/home/klee/.rvm/gems/ruby-2.3.1/gems/minitest-5.9.0/lib/minitest.rb:80:in `block in init_plugins'
/home/klee/.rvm/gems/ruby-2.3.1/gems/minitest-5.9.0/lib/minitest.rb:78:in `each'
/home/klee/.rvm/gems/ruby-2.3.1/gems/minitest-5.9.0/lib/minitest.rb:78:in `init_plugins'
/home/klee/.rvm/gems/ruby-2.3.1/gems/minitest-5.9.0/lib/minitest.rb:129:in `run'
/home/klee/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0/lib/rails/test_unit/minitest_plugin.rb:64:in `rake_run'
/home/klee/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0/lib/rails/test_unit/testing.rake:15:in `block in <top (required)>'
/home/klee/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:287:in `load'
/home/klee/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:287:in `block in load'
/home/klee/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:259:in `load_dependency'
/home/klee/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:287:in `load'
-e:1:in `<main>'
Tasks: TOP => default => test
(See full trace by running task with --trace)

I've created a branch for this:
https://github.com/braingourmets/gethdo/tree/task/rails-5
https://travis-ci.org/braingourmets/gethdo/builds/145869385

So the things to solve are:

  • Why is coffeelint not visible in the Rake tasks list?
  • How can I get coffeelint to run with Rails 5.0.0?

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.