skunk 0.5.1 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +21 -54
- data/.github/workflows/skunk.yml +4 -3
- data/.reek.yml +4 -2
- data/.rubocop_todo.yml +17 -24
- data/CHANGELOG.md +59 -37
- data/CONTRIBUTING.md +84 -0
- data/Gemfile +4 -0
- data/Gemfile-Ruby-2-4 +3 -0
- data/Gemfile-Ruby-2-5 +13 -0
- data/README.md +106 -148
- data/fastruby-logo.png +0 -0
- data/lib/skunk/cli/application.rb +7 -5
- data/lib/skunk/command_factory.rb +25 -0
- data/lib/skunk/commands/base.rb +20 -0
- data/lib/skunk/commands/compare.rb +64 -0
- data/lib/skunk/commands/compare_score.rb +39 -0
- data/lib/skunk/commands/default.rb +47 -0
- data/lib/skunk/commands/help.rb +25 -0
- data/lib/skunk/commands/shareable.rb +25 -0
- data/lib/skunk/{cli/commands → commands}/status_sharer.rb +1 -1
- data/lib/skunk/{cli/commands → commands}/version.rb +4 -0
- data/lib/skunk/rubycritic/analysed_module.rb +15 -7
- data/lib/skunk/version.rb +1 -1
- data/pull_request_template.md +11 -0
- data/skunk.gemspec +6 -7
- metadata +36 -51
- data/CODEOWNERS +0 -5
- data/lib/skunk/cli/command_factory.rb +0 -27
- data/lib/skunk/cli/commands/base.rb +0 -22
- data/lib/skunk/cli/commands/compare.rb +0 -66
- data/lib/skunk/cli/commands/compare_score.rb +0 -41
- data/lib/skunk/cli/commands/default.rb +0 -49
- data/lib/skunk/cli/commands/help.rb +0 -23
- data/lib/skunk/cli/commands/shareable.rb +0 -21
- /data/lib/skunk/{cli/commands → commands}/output.rb +0 -0
- /data/lib/skunk/{cli/commands → commands}/status_reporter.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 816d1842d51cccffa9e5284adc57ab7650bad54ef646e31bf8ac7941cd9dbb96
|
4
|
+
data.tar.gz: aaa37f4214a723eaacb3ddbae476f084f75e13b2c3fd156ab841ff9d6930739c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ede49233f3739dc19fb14bc2633acc8dbd2fbc87493673ed11eaeb22ecca3e7efa6e53c65b6e41548c8b30e00bb54349372429adc7fe9152fe77b8c12073bde1
|
7
|
+
data.tar.gz: e22e1e0d5e2bb43f1f7188b7eda3d36613baa6c3e68dd2e63d7664f01b9f7f89cc9ff3be6b72d96d75a667ebf5f836d175df4a379162193865084ad4ec4abd31
|
data/.github/workflows/main.yml
CHANGED
@@ -1,89 +1,56 @@
|
|
1
|
-
# .github/workflows/
|
1
|
+
# .github/workflows/main.yml
|
2
2
|
|
3
3
|
name: CI
|
4
|
-
on:
|
5
|
-
push:
|
6
|
-
branches:
|
7
|
-
- main
|
8
|
-
pull_request:
|
9
|
-
branches:
|
10
|
-
- main
|
4
|
+
on: [push, pull_request]
|
11
5
|
|
12
6
|
jobs:
|
13
7
|
test-ruby-2-4-x:
|
14
8
|
runs-on: ubuntu-latest
|
15
|
-
|
16
9
|
steps:
|
17
|
-
- uses: actions/checkout@
|
18
|
-
- name: Setup Ruby
|
10
|
+
- uses: actions/checkout@v2
|
11
|
+
- name: Setup Ruby 2.4
|
19
12
|
uses: ruby/setup-ruby@v1
|
20
13
|
with:
|
21
14
|
ruby-version: 2.4
|
22
|
-
bundler-cache: true
|
23
15
|
- name: Build and run tests
|
24
16
|
env:
|
25
17
|
BUNDLE_GEMFILE: "Gemfile-Ruby-2-4"
|
26
18
|
run: |
|
27
|
-
gem install bundler
|
19
|
+
gem install bundler -v 2.3
|
28
20
|
bundle install --jobs 4 --retry 3
|
29
21
|
bundle exec rake
|
22
|
+
|
30
23
|
test-ruby-2-5-x:
|
31
24
|
runs-on: ubuntu-latest
|
32
|
-
|
33
25
|
steps:
|
34
|
-
- uses: actions/checkout@
|
35
|
-
- name: Setup Ruby
|
26
|
+
- uses: actions/checkout@v2
|
27
|
+
- name: Setup Ruby 2.5
|
36
28
|
uses: ruby/setup-ruby@v1
|
37
29
|
with:
|
38
30
|
ruby-version: 2.5
|
39
|
-
bundler-cache: true
|
40
|
-
- name: Build and run tests
|
41
|
-
run: |
|
42
|
-
gem install bundler
|
43
|
-
bundle install --jobs 4 --retry 3
|
44
|
-
bundle exec rake
|
45
|
-
test-ruby-2-6-x:
|
46
|
-
runs-on: ubuntu-latest
|
47
|
-
|
48
|
-
steps:
|
49
|
-
- uses: actions/checkout@v1
|
50
|
-
- name: Setup Ruby
|
51
|
-
uses: ruby/setup-ruby@v1
|
52
|
-
with:
|
53
|
-
ruby-version: 2.6
|
54
|
-
bundler-cache: true
|
55
|
-
- name: Build and run tests
|
56
|
-
run: |
|
57
|
-
gem install bundler
|
58
|
-
bundle install --jobs 4 --retry 3
|
59
|
-
bundle exec rake
|
60
|
-
test-ruby-2-7-x:
|
61
|
-
runs-on: ubuntu-latest
|
62
|
-
|
63
|
-
steps:
|
64
|
-
- uses: actions/checkout@v1
|
65
|
-
- name: Setup Ruby
|
66
|
-
uses: ruby/setup-ruby@v1
|
67
|
-
with:
|
68
|
-
ruby-version: 2.7
|
69
|
-
bundler-cache: true
|
70
31
|
- name: Build and run tests
|
32
|
+
env:
|
33
|
+
BUNDLE_GEMFILE: "Gemfile-Ruby-2-5"
|
71
34
|
run: |
|
72
|
-
gem install bundler
|
35
|
+
gem install bundler -v 2.3.26
|
73
36
|
bundle install --jobs 4 --retry 3
|
74
37
|
bundle exec rake
|
75
|
-
test-ruby-3-0-x:
|
76
|
-
runs-on: ubuntu-latest
|
77
38
|
|
39
|
+
test-ruby:
|
40
|
+
runs-on: ${{ matrix.os }}-latest
|
41
|
+
strategy:
|
42
|
+
matrix:
|
43
|
+
os: [ubuntu]
|
44
|
+
ruby-version: ["2.6", "2.7", "3.0", "3.1", "3.2"]
|
78
45
|
steps:
|
79
|
-
- uses: actions/checkout@
|
80
|
-
- name: Setup Ruby
|
46
|
+
- uses: actions/checkout@v2
|
47
|
+
- name: Setup Ruby ${{ matrix.ruby-version }}
|
81
48
|
uses: ruby/setup-ruby@v1
|
82
49
|
with:
|
83
|
-
ruby-version:
|
50
|
+
ruby-version: ${{ matrix.ruby-version }}
|
84
51
|
bundler-cache: true
|
85
52
|
- name: Build and run tests
|
86
53
|
run: |
|
87
|
-
gem install bundler
|
54
|
+
gem install bundler -v 2.4.6
|
88
55
|
bundle install --jobs 4 --retry 3
|
89
56
|
bundle exec rake
|
data/.github/workflows/skunk.yml
CHANGED
@@ -6,11 +6,12 @@ jobs:
|
|
6
6
|
runs-on: ubuntu-latest
|
7
7
|
|
8
8
|
steps:
|
9
|
-
- uses: actions/checkout@
|
9
|
+
- uses: actions/checkout@v2
|
10
10
|
- name: Setup Ruby
|
11
|
-
uses:
|
11
|
+
uses: ruby/setup-ruby@v1
|
12
12
|
with:
|
13
|
-
ruby-version:
|
13
|
+
ruby-version: 3.1
|
14
|
+
bundler-cache: true
|
14
15
|
- name: Run test suite with COVERAGE=true
|
15
16
|
run: |
|
16
17
|
gem install bundler
|
data/.reek.yml
CHANGED
@@ -24,5 +24,7 @@ detectors:
|
|
24
24
|
- Skunk::Cli::Options::Argv#parse
|
25
25
|
UtilityFunction:
|
26
26
|
exclude:
|
27
|
-
-
|
28
|
-
- Skunk::
|
27
|
+
- capture_output_streams
|
28
|
+
- Skunk::Command::Compare#analyse_modified_files
|
29
|
+
- Skunk::Command::Compare#build_details_path
|
30
|
+
- Skunk::Command::Shareable#sharing?
|
data/.rubocop_todo.yml
CHANGED
@@ -1,64 +1,57 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2023-07-22 00:31:00 UTC using RuboCop version 1.54.2.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
-
# Offense count:
|
10
|
-
# Configuration parameters: Include.
|
9
|
+
# Offense count: 1
|
10
|
+
# Configuration parameters: Severity, Include.
|
11
11
|
# Include: **/*.gemspec
|
12
12
|
Gemspec/RequiredRubyVersion:
|
13
13
|
Exclude:
|
14
|
-
- 'gemfiles/skunk.gemspec'
|
15
14
|
- 'skunk.gemspec'
|
16
15
|
|
17
16
|
# Offense count: 1
|
18
|
-
#
|
17
|
+
# This cop supports safe autocorrection (--autocorrect).
|
19
18
|
Layout/ClosingHeredocIndentation:
|
20
19
|
Exclude:
|
21
|
-
- 'lib/skunk/
|
20
|
+
- 'lib/skunk/commands/status_reporter.rb'
|
22
21
|
|
23
22
|
# Offense count: 1
|
24
|
-
#
|
23
|
+
# This cop supports safe autocorrection (--autocorrect).
|
25
24
|
Layout/HeredocIndentation:
|
26
25
|
Exclude:
|
27
|
-
- 'lib/skunk/
|
28
|
-
|
29
|
-
# Offense count: 1
|
30
|
-
# Configuration parameters: AllowedMethods.
|
31
|
-
# AllowedMethods: enums
|
32
|
-
Lint/ConstantDefinitionInBlock:
|
33
|
-
Exclude:
|
34
|
-
- 'test/lib/skunk/cli/commands/help_test.rb'
|
26
|
+
- 'lib/skunk/commands/status_reporter.rb'
|
35
27
|
|
36
28
|
# Offense count: 2
|
29
|
+
# Configuration parameters: AllowedParentClasses.
|
37
30
|
Lint/MissingSuper:
|
38
31
|
Exclude:
|
39
32
|
- 'lib/skunk/cli/application.rb'
|
40
|
-
- 'lib/skunk/
|
33
|
+
- 'lib/skunk/commands/base.rb'
|
41
34
|
|
42
35
|
# Offense count: 1
|
43
|
-
# Configuration parameters:
|
36
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
44
37
|
Metrics/AbcSize:
|
45
38
|
Max: 18
|
46
39
|
|
47
40
|
# Offense count: 7
|
48
|
-
# Configuration parameters: CountComments, CountAsOne,
|
49
|
-
#
|
41
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
42
|
+
# AllowedMethods: refine
|
50
43
|
Metrics/BlockLength:
|
51
|
-
Max:
|
44
|
+
Max: 76
|
52
45
|
|
53
46
|
# Offense count: 2
|
54
|
-
# Configuration parameters: CountComments, CountAsOne,
|
47
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
55
48
|
Metrics/MethodLength:
|
56
49
|
Max: 13
|
57
50
|
|
58
51
|
# Offense count: 1
|
59
|
-
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
|
52
|
+
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
|
60
53
|
# SupportedStyles: snake_case, normalcase, non_integer
|
61
|
-
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
|
54
|
+
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
|
62
55
|
Naming/VariableNumber:
|
63
56
|
Exclude:
|
64
|
-
- 'lib/skunk/
|
57
|
+
- 'lib/skunk/commands/status_sharer.rb'
|
data/CHANGELOG.md
CHANGED
@@ -5,52 +5,74 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
-
##
|
8
|
+
## main [(unreleased)](https://github.com/fastruby/skunk/compare/v0.5.3...HEAD)
|
9
9
|
|
10
|
-
|
10
|
+
* <INSERT YOUR FEATURE OR BUGFIX HERE>
|
11
11
|
|
12
|
-
|
12
|
+
## v0.5.3 / 2023-12-01 [(commits)](https://github.com/fastruby/skunk/compare/v0.5.2...v0.5.3)
|
13
13
|
|
14
|
-
|
14
|
+
* [BUGFIX: Update reek, rubocop, and terminal-table dependencies](https://github.com/fastruby/skunk/pull/111)
|
15
|
+
* [BUGFIX: Better test coverage tracking for skunk](https://github.com/fastruby/skunk/pull/108)
|
16
|
+
* [FEATURE: Add Ruby 3.2 Support](https://github.com/fastruby/skunk/pull/106)
|
17
|
+
* [BUGFIX: Fix skunk workflow](https://github.com/fastruby/skunk/pull/104)
|
18
|
+
* [BUGFIX: Fix documentation and refactor `skunk_score` method](https://github.com/fastruby/skunk/pull/102)
|
19
|
+
* [FEATURE: Improve main workflow](https://github.com/fastruby/skunk/pull/99)
|
20
|
+
* [BUGFIX: Fix analized module test](https://github.com/fastruby/skunk/pull/98)
|
15
21
|
|
16
|
-
|
17
|
-
* [FEATURE] Rename the tech debt metric: StinkScore => SkunkScore. It's a little friendlier.
|
18
|
-
* [FEATURE] Add `--out=file.txt` support to the command line (by [@manuca]())
|
19
|
-
* [BUGFIX] Skip both nested and top level spec and test folders
|
22
|
+
## v0.5.2 / 2022-04-27 [(commits)](https://github.com/fastruby/skunk/compare/v0.5.1...v0.5.2)
|
20
23
|
|
21
|
-
|
22
|
-
* [BUGFIX
|
24
|
+
* [FEATURE: Support more rubies](https://github.com/fastruby/skunk/pull/92)
|
25
|
+
* [BUGFIX: Fixed share issue with version command](https://github.com/fastruby/skunk/pull/83)
|
26
|
+
* [FEATURE: Add PR Template](https://github.com/fastruby/skunk/pull/72)
|
27
|
+
* [BUGFIX: Fix Sponsorship logo path in README](https://github.com/fastruby/skunk/pull/73)
|
28
|
+
* [BUGFIX: Test with Ruby 3.1](https://github.com/fastruby/skunk/pull/85)
|
29
|
+
* [BUGFIX: Fix changelog uri](https://github.com/fastruby/skunk/pull/90)
|
23
30
|
|
24
|
-
##
|
25
|
-
* [BUGFIX] Fixes table width issues (by [@etagwerker]())
|
31
|
+
## v0.5.1 / 2021-02-17 [(commits)](https://github.com/fastruby/skunk/compare/v0.5.0...v0.5.1)
|
26
32
|
|
27
|
-
|
28
|
-
* [FEATURE] Add `--version` support to the command line. (by [@bronzdoc]())
|
29
|
-
* [FEATURE] Stop accepting `-p <path>` in the command line. It's redundant and it's not working anyway. (by [@etagwerker]())
|
30
|
-
* [BUGFIX] Change "StinkScore" formula to skip `churn_times_cost` (by [@etagwerker]())
|
31
|
-
* [BUGFIX] Fixes #12 (by [@sebastian-palma]())
|
33
|
+
* [BUGFIX: Fix bug related to compare plus share code](https://github.com/fastruby/skunk/pull/69)
|
32
34
|
|
33
|
-
##
|
34
|
-
### Changed
|
35
|
-
* [BUGFIX] Change "StinkScore" formula to skip `churn_times_cost` (by [@etagwerker]())
|
35
|
+
## v0.5.0 / 2020-09-18 [(commits)](https://github.com/fastruby/skunk/compare/v0.4.2...v0.5.0)
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
* [
|
37
|
+
* [FEATURE: Share your results using an environment variable](https://github.com/fastruby/skunk/pull/56)
|
38
|
+
* [FEATURE: Rename the tech debt metric: StinkScore => SkunkScore. It's a little friendlier.](https://github.com/fastruby/skunk/pull/36)
|
39
|
+
* [FEATURE: Add `--out=file.txt` support to the command line](https://github.com/fastruby/skunk/pull/47)
|
40
|
+
* [BUGFIX: Skip both nested and top level spec and test folders](https://github.com/fastruby/skunk/pull/65)
|
40
41
|
|
41
|
-
##
|
42
|
-
### Changed
|
43
|
-
* [FEATURE] Added Travis CI badge to README (by [@themayurkumbhar]())
|
44
|
-
* [FEATURE] Now you can compare "StinkScore" between branches (by [@etagwerker]())
|
45
|
-
* [BUGFIX] Add contributor covenant doc (by [@etagwerker]())
|
46
|
-
* [BUGFIX] Make sure tests work even you don't have a `coverage/.resultset.json` file (by [@etagwerker]())
|
47
|
-
* [BUGFIX] Make tests easier to maintain (by [@etagwerker]())
|
42
|
+
## v0.4.2 / 2020-02-09 [(commits)](https://github.com/fastruby/skunk/compare/v0.4.1...v0.4.2)
|
48
43
|
|
49
|
-
|
50
|
-
### Changed
|
51
|
-
- [FEATURE] Now `skunk` will not report status for files that start with `test/` or `spec/` (by [@etagwerker]())
|
44
|
+
* [BUGFIX: Fixes table width issues by rounding values](https://github.com/fastruby/skunk/commit/80e2e4743bcb79619f9bb5aed9808bac1ca78231)
|
52
45
|
|
53
|
-
##
|
54
|
-
|
55
|
-
|
56
|
-
|
46
|
+
## v0.4.1 / 2020-02-09 [(commits)](https://github.com/fastruby/skunk/compare/v0.4.0...v0.4.1)
|
47
|
+
|
48
|
+
* [BUGFIX: Fixes table width issues](https://github.com/fastruby/skunk/commit/372bc506f408e3647ce48b7bc149234c9da71168)
|
49
|
+
|
50
|
+
## v0.4.0 / 2020-02-08 [(commits)](https://github.com/fastruby/skunk/compare/v0.3.2...v0.4.0)
|
51
|
+
|
52
|
+
* [FEATURE: Add `--version` support to the command line.](https://github.com/fastruby/skunk/pull/18)
|
53
|
+
* [FEATURE: Stop accepting `-p <path>` in the command line. It's redundant and it's not working anyway.](https://github.com/fastruby/skunk/commit/40976c65a1176b47d3b67f75cd7b4ec92d7c4c88)
|
54
|
+
* [BUGFIX: Create compare_root_directory when it does not exist](https://github.com/fastruby/skunk/pull/23) (#12)
|
55
|
+
|
56
|
+
## v0.3.2 / 2019-11-23 [(commits)](https://github.com/fastruby/skunk/compare/v0.3.1...v0.3.2)
|
57
|
+
|
58
|
+
* [BUGFIX: Make variable binding friendly to avoid warning](https://github.com/fastruby/skunk/pull/20)
|
59
|
+
|
60
|
+
## v0.3.1 / 2019-11-19 [(commits)](https://github.com/fastruby/skunk/compare/v0.3.0...v0.3.1)
|
61
|
+
|
62
|
+
* [BUGFIX: Change "StinkScore" formula to skip `churn_times_cost`](https://github.com/fastruby/skunk/pull/14)
|
63
|
+
|
64
|
+
## v0.3.0 / 2019-11-19 [(commits)](https://github.com/fastruby/skunk/compare/v0.2.0...v0.3.0)
|
65
|
+
|
66
|
+
* [FEATURE: Added Travis CI badge to README](https://github.com/fastruby/skunk/pull/3)
|
67
|
+
* [FEATURE: Now you can compare "StinkScore" between branches](https://github.com/fastruby/skunk/pull/11)
|
68
|
+
* [BUGFIX Add contributor covenant doc](https://github.com/fastruby/skunk/commit/c765a6406f0d53043e8d1c51309d6372196e9f94)
|
69
|
+
* [BUGFIX Make sure tests work even you don't have a `coverage/.resultset.json` file](https://github.com/fastruby/skunk/pull/7)
|
70
|
+
* [BUGFIX: Make tests easier to maintain](https://github.com/fastruby/skunk/pull/10)
|
71
|
+
|
72
|
+
## v0.2.0 / 2019-10-16 [(commits)](https://github.com/fastruby/skunk/compare/v0.1.0...v0.2.0)
|
73
|
+
|
74
|
+
* [FEATURE: Now `skunk` will not report status for files that start with `test/` or `spec/`](https://github.com/fastruby/skunk/commit/6f1a3c60967abb114576e71084d80e12b0f0235f) (by
|
75
|
+
|
76
|
+
## v0.1.0 / 2019-10-16
|
77
|
+
|
78
|
+
* [FEATURE: Now `skunk` uses `rubycritic-simplecov` to generate a console report with a list of files and their "StinkScore"](https://github.com/fastruby/skunk/commit/2ccc5b885b5e12135d963e779566d27d6eefa140)
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
# Contributing to Skunk
|
2
|
+
Have a fix for a problem you've been running into or an idea for a new feature you think would be useful? Bug reports and pull requests are welcome on GitHub at [https://github.com/fastruby/skunk](https://github.com/fastruby/skunk).
|
3
|
+
|
4
|
+
Here's what you need to do:
|
5
|
+
|
6
|
+
- Read and understand the [Code of Conduct](https://github.com/fastruby/skunk/blob/main/CODE_OF_CONDUCT.md).
|
7
|
+
- Fork this repo and clone your fork to somewhere on your machine.
|
8
|
+
- [Ensure that you have a working environment](#setting-up-your-environment)
|
9
|
+
- Read up on the [architecture of the gem](#architecture), and [run the tests](#running-all-tests).
|
10
|
+
- Cut a new branch and write a failing test for the feature or bug fix you plan on implementing.
|
11
|
+
- [Update the changelog when applicable](#a-word-on-the-changelog).
|
12
|
+
- Read the guidelines when [Releasing a new version](#releasing-a-new-version)
|
13
|
+
- Push to your fork and submit a pull request.
|
14
|
+
- [Make sure the test suite passes on GitHub Actions and make any necessary changes to your branch to bring it to green.](#continuous-integration).
|
15
|
+
- Check out the [Help Wanted](#help-wanted) section for suggestions on how to support Skunk.
|
16
|
+
|
17
|
+
## Setting up your environment
|
18
|
+
To install the dependencies, run:
|
19
|
+
|
20
|
+
```bash
|
21
|
+
bin/setup
|
22
|
+
```
|
23
|
+
|
24
|
+
You can also run `bin/console` for an interactive prompt that will allow you to experiment with the gem.
|
25
|
+
|
26
|
+
To install this gem onto your local machine, run:
|
27
|
+
|
28
|
+
`bundle exec rake install`.
|
29
|
+
|
30
|
+
## Architecture
|
31
|
+
|
32
|
+
This project follows the typical structure for a gem: code is located in `lib` and tests are in `test`.
|
33
|
+
|
34
|
+
Under `/lib/skunk`, you find the CLI commands. Under `lib/skunk/rubycritic` you find skunk's extension from `rubycritic` gem.
|
35
|
+
|
36
|
+
### Running all tests
|
37
|
+
|
38
|
+
To run all of the tests, simply run:
|
39
|
+
|
40
|
+
```bash
|
41
|
+
bundle exec rake
|
42
|
+
```
|
43
|
+
|
44
|
+
## A word on the changelog
|
45
|
+
You may also notice that we have a changelog in the form of [CHANGELOG.md](CHANGELOG.md). We use a format based on [Keep A Changelog](https://keepachangelog.com/en/1.0.0/).
|
46
|
+
|
47
|
+
The important things to keep in mind are:
|
48
|
+
|
49
|
+
- If your PR closes any open GitHub issue, make sure you include `Closes #XXXX` in your comment.
|
50
|
+
- New additions get added under the main (unreleased) heading;
|
51
|
+
- Attach a link to the PR with the following format:
|
52
|
+
|
53
|
+
* [<FEATURE | BUGFIX | CHORE>: Description of changes](github.com/link/to/pr).
|
54
|
+
|
55
|
+
## Releasing a new version
|
56
|
+
To release a new version, update the version number in `version.rb`.
|
57
|
+
|
58
|
+
To create a git tag for the version, push git commits and tags, and push the `.gem` file to rubygems.org, run:
|
59
|
+
|
60
|
+
`bundle exec rake release`
|
61
|
+
|
62
|
+
## When Submitting a Pull Request:
|
63
|
+
* If your PR closes any open GitHub issues, please include `Closes #XXXX` in your comment.
|
64
|
+
* Please include a summary of the change and which issue is fixed or which feature is introduced.
|
65
|
+
* If changes to the behavior are made, clearly describe what are the changes and why.
|
66
|
+
* If changes to the UI are made, please include screenshots of the before and after.
|
67
|
+
|
68
|
+
## Continuous integration
|
69
|
+
After opening your Pull Request, please make sure that all tests pass on the CI, to make sure your changes work in all possible environments. GitHub Actions will kick in after you push up a branch or open a PR.
|
70
|
+
|
71
|
+
If the build fails, click on a failed job and scroll through its output to verify what is the problem. Push your changes to your branch until the build is green.
|
72
|
+
|
73
|
+
## Help Wanted
|
74
|
+
Skunk's formula is not perfect and it is certainly controversial. The SkunkScore could be calculated per method. This would provide a more accurate representation of the average SkunkScore in a module.
|
75
|
+
|
76
|
+
The SkunkScore of a module should be the average of the SkunkScores of all of its methods. Right now the SkunkScore is calculated using the totals for a module:
|
77
|
+
|
78
|
+
- Total Code Coverage Percentage per Module
|
79
|
+
- Total Churn per Module
|
80
|
+
- Total Cost per Module
|
81
|
+
|
82
|
+
Feel free to review and submit your suggestions to improve the method [RubyCritic::AnalysedModule#skunk_score](https://github.com/fastruby/skunk/blob/main/lib/skunk/rubycritic/analysed_module.rb#L33).
|
83
|
+
|
84
|
+
📘 Read [Escaping The Tar Pit: Introducing Skunk v0.3.2 at RubyConf 2019](https://www.fastruby.io/blog/code-quality/escaping-the-tar-pit-at-rubyconf.html) and [Churn vs. Complexity vs. Code Coverage](https://www.fastruby.io/blog/code-quality/churn-vs-complexity-vs-coverage.html) for more details about the `skunk_score` method.
|
data/Gemfile
CHANGED
data/Gemfile-Ruby-2-4
CHANGED
data/Gemfile-Ruby-2-5
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
6
|
+
|
7
|
+
# Specify your gem's dependencies in skunk.gemspec
|
8
|
+
gemspec
|
9
|
+
|
10
|
+
gem "reek", "~> 6.0.0"
|
11
|
+
gem "rubocop", "~> 1.0"
|
12
|
+
gem "simplecov", "< 0.19.0"
|
13
|
+
gem "vcr", "< 6.1.0"
|