diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index c547edd..5b3395c 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -4,6 +4,9 @@ on: push: branches: - master + pull_request: + branches: + - master jobs: codecov: runs-on: ubuntu-22.04 @@ -14,8 +17,7 @@ jobs: ruby-version: '2.7' - run: bundle update - run: bundle exec rake - - uses: codecov/codecov-action@v3 + - uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} - file: coverage/.resultset.json fail_ci_if_error: true diff --git a/.simplecov b/.simplecov index 282adf3..76099de 100644 --- a/.simplecov +++ b/.simplecov @@ -18,21 +18,18 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -if Gem.win_platform? - SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ - SimpleCov::Formatter::HTMLFormatter - ] - SimpleCov.start do - add_filter '/test/' - add_filter '/features/' - end -else - SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new( - SimpleCov::Formatter::HTMLFormatter - ) - SimpleCov.start do - add_filter '/test/' - add_filter '/features/' - minimum_coverage 90 - end +SimpleCov.formatter = if Gem.win_platform? + SimpleCov::Formatter::MultiFormatter[ + SimpleCov::Formatter::HTMLFormatter + ] + else + SimpleCov::Formatter::MultiFormatter.new( + SimpleCov::Formatter::HTMLFormatter + ) + end + +SimpleCov.start do + add_filter '/test/' + add_filter '/features/' + minimum_coverage 90 end diff --git a/Gemfile b/Gemfile index 8bfca51..3ed1bba 100644 --- a/Gemfile +++ b/Gemfile @@ -30,5 +30,6 @@ gem 'rspec-rails', '5.1.2', require: false gem 'rubocop', '1.60.2', require: false gem 'rubocop-rspec', '2.22.0', require: false gem 'simplecov', '0.22.0', require: false +gem 'simplecov-cobertura', '~> 2.1' gem 'slop', '4.9.2', require: false gem 'xcop', '0.7.1', require: false diff --git a/README.md b/README.md index 76b6767..28f8d56 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![rake](https://github.com/cqfn/pdd/actions/workflows/rake.yml/badge.svg)](https://github.com/cqfn/pdd/actions/workflows/rake.yml) [![PDD status](http://www.0pdd.com/svg?name=cqfn/pdd)](http://www.0pdd.com/p?name=cqfn/pdd) -[![codecov](https://codecov.io/gh/cqfn/pdd/branch/master/graph/badge.svg)](https://codecov.io/gh/cqfn/pdd) +[![codecov](https://codecov.io/gh/yegor256/pdd/branch/master/graph/badge.svg)](https://codecov.io/gh/yegor/pdd) [![Hits-of-Code](https://hitsofcode.com/github/cqfn/pdd)](https://hitsofcode.com/view/github/cqfn/pdd) [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/cqfn/pdd/blob/master/LICENSE.txt) [![Gem Version](https://badge.fury.io/rb/pdd.svg)](http://badge.fury.io/rb/pdd) @@ -25,39 +25,7 @@ Read [_PDD in Action_](http://www.yegor256.com/2017/04/05/pdd-in-action.html) and watch [this webinar](https://www.youtube.com/watch?v=nsYGC2aUwfQ). -## Installation -
- -### Prerequisites: `Ruby installed` and `Libmagic` - -
- -#### Ruby version 2.7+ - - -[Ruby installation instruction](https://www.ruby-lang.org/en/documentation/installation/) -
-
- - -#### Libmagic library - - -**For Debian/Ubuntu:** -```bash -$ apt install libmagic-dev -``` -**For Mac** -```bash -$ brew install libmagic -``` -**For Windows** -Unfortunately, there is no easy way to install, please use WSL - -
-
- -Then, install our gem: +First, make sure Ruby 2.6+ and [`libmagic`](#how-to-install-libmagic) are installed. Then, install our gem: ```bash $ gem install pdd @@ -70,6 +38,7 @@ $ pdd --help ``` ## Usage + You can exclude & include certain number of files from the search via these options: ```bash @@ -106,6 +75,7 @@ $ pdd [--verbose] [--quiet] [--remove] [--skip-gitignore] [--skip-errors] \ [--source ] [--file puzzles_file.xml] [--include src/**/*.py] \ [--format xml|html] [--rule min-words:5] [--exclude src/**/*.java] ``` + | Parameter | Description | |-------------------------|---------------------------------------------------------------------------------------| | --verbose | Enable verbose (debug) mode. --file must be used in case of using this option | @@ -294,6 +264,24 @@ The most interesting parts of each puzzle are: - `lines` is where the puzzle is found, inside the file. +## How to install libmagic + +For Debian/Ubuntu: + +```bash +$ apt install libmagic-dev +``` + +For Mac: + +```bash +$ brew install libmagic +``` + +Unfortunately, there is no easy way to install on Windows, try to use +[WSL](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux) or +[Docker](https://www.docker.com/). + ## How to contribute Read [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html). diff --git a/test/test__helper.rb b/test/test__helper.rb index f1610ae..f0240bb 100644 --- a/test/test__helper.rb +++ b/test/test__helper.rb @@ -23,6 +23,9 @@ require 'simplecov' SimpleCov.start +require 'simplecov-cobertura' +SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter + require 'minitest/autorun' require_relative '../lib/pdd'