Skip to content

Commit

Permalink
[#238] Sink with master and update codecov-action (just released)
Browse files Browse the repository at this point in the history
  • Loading branch information
pnatashap committed Feb 1, 2024
2 parents 291030b + 8db7aaa commit bb3f370
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 53 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
codecov:
runs-on: ubuntu-22.04
Expand All @@ -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
31 changes: 14 additions & 17 deletions .simplecov
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
56 changes: 22 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
<details><summary>

### Prerequisites: `Ruby installed` and `Libmagic`
</summary>
<details><summary>

#### Ruby version 2.7+
</summary>

[Ruby installation instruction](https://www.ruby-lang.org/en/documentation/installation/)
</details>
<details>
<summary>

#### Libmagic library
</summary>

**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

</details>
</details>

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
Expand All @@ -70,6 +38,7 @@ $ pdd --help
```

## Usage

You can exclude & include certain number of files from the search via these options:

```bash
Expand Down Expand Up @@ -106,6 +75,7 @@ $ pdd [--verbose] [--quiet] [--remove] [--skip-gitignore] [--skip-errors] \
[--source <project_dir_path>] [--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 |
Expand Down Expand Up @@ -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).
Expand Down
3 changes: 3 additions & 0 deletions test/test__helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
require 'simplecov'
SimpleCov.start

require 'simplecov-cobertura'
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter

require 'minitest/autorun'
require_relative '../lib/pdd'

Expand Down

0 comments on commit bb3f370

Please sign in to comment.