Skip to content

Instantly share code, notes, and snippets.

@sanemat
Last active August 29, 2015 14:15
Show Gist options
  • Save sanemat/5416e4f701922a47773a to your computer and use it in GitHub Desktop.
Save sanemat/5416e4f701922a47773a to your computer and use it in GitHub Desktop.
lintとか #tng15

Lint for JavaScript

  • eslint
  • jscs
  • jshint
  • jslint
  • Closure Linter
  • coffeelint
  • tslint

lintにかかわらず、こういう開発便利系何使ってる? 何知ってる?

pronto

で、pronto gemってのがある Ruby

これjsのutilも使いたい

pronto-jshint を参照しよう! -> jshintrb ??? イマココ

↓みたいな感じにしたい

pronto pick-patch | any-command | pronto github_pr

For Ruby

  • rubocop
  • brakeman
  • rails best practice

Web service

  • hound-ci
@sanemat
Copy link
Author

sanemat commented Feb 13, 2015

eslintの場合 checkstyle, jslint-xml がparseしやすい

@sanemat
Copy link
Author

sanemat commented Feb 13, 2015

@sanemat
Copy link
Author

sanemat commented Feb 13, 2015

rubocop とrubocop-checkstyle_formatter, file nameがフルパスだ

$ rubocop --require rubocop/formatter/checkstyle_formatter --format RuboCop::Formatter::CheckstyleFormatter lib/github_api.rb
<?xml version='1.0'?>
<checkstyle>
  <file name='/Users/sane/work/tachiko/pigeon.tachikoma.io/lib/github_api.rb'>
    <error line='4' column='0' severity='info' message='Class definition is too long. [164/100]' source='com.puppycrawl.tools.checkstyle.Metrics/ClassLength'/>
    <error line='42' column='2' severity='info' message='Method has too many lines. [11/10]' source='com.puppycrawl.tools.checkstyle.Metrics/MethodLength'/>
    <error line='52' column='4' severity='info' message='Favor modifier `unless` usage when having a single-line body. Another good alternative is the usage of control flow `&amp;&amp;`/`||`.' source='com.puppycrawl.tools.checkstyle.Style/IfUnlessModifier'/>
    <error line='82' column='2' severity='info' message='Assignment Branch Condition size for fork_from_this is too high. [22.65/15]' source='com.puppycrawl.tools.checkstyle.Metrics/AbcSize'/>
    <error line='82' column='2' severity='info' message='Method has too many lines. [12/10]' source='com.puppycrawl.tools.checkstyle.Metrics/MethodLength'/>
    <error line='187' column='2' severity='info' message='Method has too many lines. [11/10]' source='com.puppycrawl.tools.checkstyle.Metrics/MethodLength'/>
  </file>
</checkstyle>

@sanemat
Copy link
Author

sanemat commented Feb 15, 2015

errorなしだとこんな出力になる

<?xml version='1.0'?>
<checkstyle>
  <file name='/Users/sane/work/tachiko/pigeon.tachikoma.io/Rakefile'/>
</checkstyle>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment