From 889c4ce4d9aa5583475eee1fe1da0be733f93b49 Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 11 Jun 2020 03:29:42 -0500 Subject: [PATCH] Add Code Climate integration. --- .codeclimate.yml | 37 +++++++++++++++++++++++++++++++++++++ .rubocop.yml | 15 +++++++++++++++ README.md | 2 ++ 3 files changed, 54 insertions(+) create mode 100644 .codeclimate.yml diff --git a/.codeclimate.yml b/.codeclimate.yml new file mode 100644 index 000000000..dbb000b8a --- /dev/null +++ b/.codeclimate.yml @@ -0,0 +1,37 @@ +version: 2 +checks: + argument-count: + config: + threshold: 4 + file-lines: + config: + threshold: 500 + method-count: + config: + threshold: 40 + method-lines: + config: + threshold: 100 +plugins: + eslint: + enabled: true + channel: "eslint-6" + config: + extensions: + - .js + - .js.erb + rubocop: + enabled: true + channel: "rubocop-0-83" + stylelint: + enabled: true +exclude_patterns: + - "app/javascript/vendor" + - "config/" + - "db/" + - "lib/" + - "log/" + - "script/" + - "tmp/" + - "**/node_modules/" + - "**/test/" diff --git a/.rubocop.yml b/.rubocop.yml index 30564b41f..db2025ce1 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -37,6 +37,21 @@ Layout/SpaceInsideBlockBraces: Layout/SpaceInsideHashLiteralBraces: Enabled: false +Metrics/BlockNesting: + Max: 4 + +Metrics/ClassLength: + Max: 500 + +Metrics/MethodLength: + Max: 100 + +Metrics/ModuleLength: + Max: 500 + +Metrics/ParameterLists: + Max: 4 + Lint/InheritException: EnforcedStyle: standard_error diff --git a/README.md b/README.md index 46c806ab2..b96b921a2 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Maintainability](https://api.codeclimate.com/v1/badges/a51f46fb460a35104d82/maintainability)](https://codeclimate.com/github/danbooru/danbooru/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/a51f46fb460a35104d82/test_coverage)](https://codeclimate.com/github/danbooru/danbooru/test_coverage) + ## Installation It is recommended that you install Danbooru on a Debian-based system