From 158ed5d857bc968e96f171239ce1152fd7538ce3 Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Fri, 26 Jan 2024 05:55:31 +0300 Subject: [PATCH 1/6] install --- README.md | 54 +++++++++++++++++++++--------------------------------- 1 file changed, 21 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 0d49523..ab73c12 100644 --- a/README.md +++ b/README.md @@ -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` 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 | @@ -265,6 +235,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 +``` + +For Windows: + +Unfortunately, there is no easy way to install, try to use WSL. + ## How to contribute Read [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html). From 9c367215ccd7e6bf781c2c1e9696f498c32e6000 Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Fri, 26 Jan 2024 05:56:13 +0300 Subject: [PATCH 2/6] link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ab73c12..9289e19 100644 --- a/README.md +++ b/README.md @@ -25,7 +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). -First, make sure Ruby 2.6+ and `libmagic` are installed. 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 From f536c6c2e7558c59ea8d12b476fd6521a51cf626 Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Fri, 26 Jan 2024 05:57:57 +0300 Subject: [PATCH 3/6] links --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9289e19..506254a 100644 --- a/README.md +++ b/README.md @@ -249,9 +249,9 @@ For Mac: $ brew install libmagic ``` -For Windows: - -Unfortunately, there is no easy way to install, try to use WSL. +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 From 5428b3aab5287da844837107fc29311d72d773bf Mon Sep 17 00:00:00 2001 From: Natalia Pozhidaeva Date: Mon, 29 Jan 2024 20:51:00 -0500 Subject: [PATCH 4/6] [#238] Formatter is required for codecov report --- .github/workflows/codecov.yml | 1 - Gemfile | 1 + test/test__helper.rb | 3 +++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index c547edd..c3b385e 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -17,5 +17,4 @@ jobs: - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} - file: coverage/.resultset.json fail_ci_if_error: true diff --git a/Gemfile b/Gemfile index 35b4ca5..c5fed8b 100644 --- a/Gemfile +++ b/Gemfile @@ -30,5 +30,6 @@ gem 'rspec-rails', '5.1.2', require: false gem 'rubocop', '1.53.1', 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/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' From 0b1750068f76f45ed36363f2b20703f01c732d07 Mon Sep 17 00:00:00 2001 From: Natalia Pozhidaeva Date: Mon, 29 Jan 2024 22:44:26 -0500 Subject: [PATCH 5/6] [#238] Add codecov run to PR creation --- .github/workflows/codecov.yml | 3 +++ .simplecov | 23 ++++++++++------------- README.md | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index c3b385e..f85e212 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 diff --git a/.simplecov b/.simplecov index 282adf3..5934d93 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 = if Gem.win_platform? + SimpleCov::Formatter::MultiFormatter[ SimpleCov::Formatter::HTMLFormatter ] - SimpleCov.start do - add_filter '/test/' - add_filter '/features/' - end -else - SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new( + else + SimpleCov::Formatter::MultiFormatter.new( SimpleCov::Formatter::HTMLFormatter ) - SimpleCov.start do - add_filter '/test/' - add_filter '/features/' - minimum_coverage 90 - end + end + +SimpleCov.start do + add_filter '/test/' + add_filter '/features/' + minimum_coverage 90 end diff --git a/README.md b/README.md index 506254a..27289f4 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) From 8db7aaa729981f3a131687b7e2645329942646f4 Mon Sep 17 00:00:00 2001 From: Natalia Pozhidaeva Date: Mon, 29 Jan 2024 22:45:22 -0500 Subject: [PATCH 6/6] [#238] Add codecov run to PR creation --- .simplecov | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.simplecov b/.simplecov index 5934d93..76099de 100644 --- a/.simplecov +++ b/.simplecov @@ -19,13 +19,13 @@ # SOFTWARE. SimpleCov.formatter = if Gem.win_platform? - SimpleCov::Formatter::MultiFormatter[ - SimpleCov::Formatter::HTMLFormatter - ] + SimpleCov::Formatter::MultiFormatter[ + SimpleCov::Formatter::HTMLFormatter + ] else - SimpleCov::Formatter::MultiFormatter.new( - SimpleCov::Formatter::HTMLFormatter - ) + SimpleCov::Formatter::MultiFormatter.new( + SimpleCov::Formatter::HTMLFormatter + ) end SimpleCov.start do