Skip to content

kapost/codeclimate-common

Repository files navigation

Kapost Common Code Climate Configuration (KC4)

Common Robocop, Reek, CSSLint, ESLint configurations that we should be sharing between all apps.

For all the files listed in this repo, please try to avoid modifying them locally in your own projects (I've added a comment indicating such in all files that support comments). Instead, modify them here, and open a PR. This way, we can discuss as a team, and easily update all projects to use the same rules.

For Rubocop, at least, the commonalities have been extracted to a .rubocop.kapost.yml file that gets imported.

Tutorial

Make a new branch in the project you're updating, then pull down all the latest configs.

$ git checkout chore/update-codeclimate-configs
$ curl -L https://raw.githubusercontent.com/kapost/codeclimate-common/master/install.sh | bash

Both of these commands will clobber your local files, so examine the diffs, and be sure to re-incorporate any local changes for you project.

$ git status
On branch chore/codeclimate-common
Your branch is up-to-date with 'origin/chore/codeclimate-common'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

       	modified:   .rubocop.kapost.yml
       	modified:   config.reek

Untracked files:
  (use "git add <file>..." to include in what will be committed)

       	.eslintignore
       	.eslintrc
       	.scss-lint.yml
       	coffeelint.json

no changes added to commit (use "git add" and/or "git commit -a")

Kale isn't using javascript or coffee script, so just delete those files. .scss-lint.yml is new, so add it. Finally, we'll use git add -p to pick and choose the parts of .rubocop.kapost.yml and config.reek that we want. You can also use a tool like SourceTree to get a GUI to stage and discard hunks, but I like my CLI.


$ rm .eslint* coffeelint.json
$ git add .scss-lint.yml
$ git add -p .rubocop.kapost.yml config.reek
diff --git a/.rubocop.kapost.yml b/.rubocop.kapost.yml
index 9ffb601..f5779e6 100644
--- a/.rubocop.kapost.yml
+++ b/.rubocop.kapost.yml
@@ -61,6 +61,11 @@ Style/MultilineMethodCallIndentation:
   Exclude:
     - "spec/**/*.rb"

+# These are better handled by reek
+Metrics/MethodLength:
+  Enabled: false
+Metrics/ParameterLists:
+  Enabled: false

 # Rubocop's global exclude seems to fail to exclude the bin/ dir, so set all
 # the cops that are failing manually, since most of these files are
Stage this hunk [y,n,q,a,d,/,e,?]? y

diff --git a/config.reek b/config.reek
index b541b69..6b3f15a 100644
--- a/config.reek
+++ b/config.reek
@@ -20,6 +20,3 @@
 IrresponsibleModule:
   enabled: false

-# Rubocop has this covered already
-TooManyStatements:
-  enabled: false
Stage this hunk [y,n,q,a,d,/,e,?]? y

Finally, commit this whole thing, make a PR, and see what CodeClimate thinks.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages