diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index e07171a..0000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,17 +0,0 @@ -version: "2" -prepare: - fetch: - - url: "https://raw.githubusercontent.com/internetee/style-guide/master/.rubocop-ruby.yml" - path: ".rubocop.yml" -plugins: - duplication: - enabled: true - config: - languages: - - ruby - rubocop: - enabled: true - channel: rubocop-0-74 -exclude_patterns: - - "bin/" - - "test/" diff --git a/.qlty/.gitignore b/.qlty/.gitignore new file mode 100644 index 0000000..3036618 --- /dev/null +++ b/.qlty/.gitignore @@ -0,0 +1,7 @@ +* +!configs +!configs/** +!hooks +!hooks/** +!qlty.toml +!.gitignore diff --git a/.qlty/configs/.yamllint.yaml b/.qlty/configs/.yamllint.yaml new file mode 100644 index 0000000..7440066 --- /dev/null +++ b/.qlty/configs/.yamllint.yaml @@ -0,0 +1,21 @@ +extends: default + +rules: + document-start: disable + quoted-strings: + required: only-when-needed + extra-allowed: ["{|}"] + key-duplicates: {} + octal-values: + forbid-implicit-octal: true + line-length: disable + indentation: disable + new-line-at-end-of-file: disable + trailing-spaces: disable + brackets: disable + colons: disable + empty-lines: disable + comments: disable + braces: disable + comments-indentation: disable + commas: disable diff --git a/.qlty/qlty.toml b/.qlty/qlty.toml new file mode 100644 index 0000000..078abb5 --- /dev/null +++ b/.qlty/qlty.toml @@ -0,0 +1,94 @@ +# This file was automatically generated by `qlty init`. +# You can modify it to suit your needs. +# We recommend you to commit this file to your repository. +# +# This configuration is used by both Qlty CLI and Qlty Cloud. +# +# Qlty CLI -- Code quality toolkit for developers +# Qlty Cloud -- Fully automated Code Health Platform +# +# Try Qlty Cloud: https://qlty.sh +# +# For a guide to configuration, visit https://qlty.sh/d/config +# Or for a full reference, visit https://qlty.sh/d/qlty-toml +config_version = "0" + +exclude_patterns = [ + "*_min.*", + "*-min.*", + "*.min.*", + "**/.yarn/**", + "**/*.d.ts", + "**/assets/**", + "**/bower_components/**", + "**/build/**", + "**/cache/**", + "**/config/**", + "**/db/**", + "**/deps/**", + "**/dist/**", + "**/extern/**", + "**/external/**", + "**/generated/**", + "**/Godeps/**", + "**/gradlew/**", + "**/mvnw/**", + "**/node_modules/**", + "**/protos/**", + "**/seed/**", + "**/target/**", + "**/templates/**", + "**/testdata/**", + "**/vendor/**", "bin/", "test/", +] + +test_patterns = [ + "**/test/**", + "**/spec/**", + "**/*.test.*", + "**/*.spec.*", + "**/*_test.*", + "**/*_spec.*", + "**/test_*.*", + "**/spec_*.*", +] + +[smells] +mode = "comment" + +[smells.boolean_logic] +threshold = 4 + +[smells.file_complexity] +threshold = 55 + +[smells.return_statements] +threshold = 4 + +[smells.nested_control_flow] +threshold = 4 + +[smells.function_parameters] +threshold = 4 + +[smells.function_complexity] +threshold = 5 + +[smells.duplication] +threshold = 22 + +[[source]] +name = "default" +default = true + +[[plugin]] +name = "rubocop" + +[[plugin.fetch]] +url = "https://raw.githubusercontent.com/internetee/style-guide/master/.rubocop-ruby-modern.yml" +path = ".rubocop-ruby-modern.yml" + +[coverage] +enabled = true +format = "lcov" +path = "coverage/lcov.info" diff --git a/.travis.yml b/.travis.yml index a157f56..a47976d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,9 @@ rvm: cache: bundler before_install: gem install bundler -v 2.0.2 before_script: - - "curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter" - - "chmod +x ./cc-test-reporter" - - "./cc-test-reporter before-build" + - "curl https://qlty.sh | sh" + - "gem install simplecov simplecov-lcov" +script: + - "COVERAGE=true bundle exec rake test" after_script: - - "./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT" + - "qlty coverage publish coverage/lcov.info --repo internetee/directo" diff --git a/directo.gemspec b/directo.gemspec index c2ffd67..2599436 100644 --- a/directo.gemspec +++ b/directo.gemspec @@ -24,6 +24,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'pry' spec.add_development_dependency 'rake', '~> 12.3.3' spec.add_development_dependency 'simplecov', '0.17' + spec.add_development_dependency 'simplecov-lcov', '~> 0.8' spec.add_development_dependency 'webmock' spec.required_ruby_version = '>= 2.6' diff --git a/test/test_helper.rb b/test/test_helper.rb index 5bfc1af..d5f806f 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,7 +1,15 @@ if ENV['COVERAGE'] require 'simplecov' + require 'simplecov-lcov' + + SimpleCov::Formatter::LcovFormatter.config do |c| + c.report_with_single_file = true + c.single_report_path = 'coverage/lcov.info' + end + SimpleCov.start do add_filter '/test/' + formatter SimpleCov::Formatter::LcovFormatter end end