skunk 0.4.2 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: adc2e03bb20bde5ac6b5aed4eca58c01cf3d4788d55415c4b27a1f58e46dc85b
4
- data.tar.gz: cf99bb3749b677148eaca998711b8f6ac28fec40f681621c8c55f093a7294c2d
3
+ metadata.gz: 97336bcac813e609a69fe0782edbd188a72cc24919cd5ded18b9b3515bebfecb
4
+ data.tar.gz: 94a04712f97e7e36f00aedc1d046775c565714dab38fb08e698ba6196fc1981b
5
5
  SHA512:
6
- metadata.gz: e972cde74cbf4fa49ce432b1abef05bed3c7c3a4df2a2b9c2d9ec33e294a1ff5c23b2e27954d0bb8d7471cafb1078e2076ba52b53c33359cc6b243356446d852
7
- data.tar.gz: 03a64e04c03658f866d5e5b6b5baf90f0c421efec60ffd697a3507a5ab35502857679659ba12c11d7165dec5902ffff991a200039f76e95f9fe3d6a2fecded58
6
+ metadata.gz: 9996fece8b920f5de38bbd57629e9b64b78865d421a7f51011a3c63233ef60960086dfc0c73723d17bb52911b9167e624e20284cdcece502286feaa70996ee1e
7
+ data.tar.gz: 327565f1b417f77a2af14c77cb1d7d6e74057491ed154312fe189cb3997eb3526d47a6f1a73cc5600204c2aa95483f9ad117a506870128b8fcb8b85380cdca0d
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: "[BUG] "
5
+ labels: 'bug'
6
+ assignees: 'black-bunny-brigade'
7
+
8
+ ---
9
+
10
+ **IMPORTANT: please make sure you ask yourself all intro questions and fill all sections of the template.**
11
+
12
+ **Before we start...:**
13
+
14
+ - [ ] I checked the documentation and found no answer
15
+ - [ ] I checked to make sure that this issue has not already been filed
16
+ - [ ] I'm reporting the issue to the correct repository (for multi-repository projects)
17
+
18
+
19
+ **Version, Branch, or Commit:**
20
+
21
+ Inform what version, branch, commit of Skunk you are using.
22
+
23
+ **Expected behavior:**
24
+
25
+ Please include a detailed description of the behavior you were expecting when you encountered this issue.
26
+
27
+ **Actual behavior:**
28
+
29
+ Please include a detailed description of the actual behavior of the application.
30
+
31
+ **Steps to reproduce:**
32
+
33
+ How do I achieve this behavior? Use the following format to provide a step-by-step guide:
34
+
35
+ 1. Step 1: ...
36
+ 2. Step 2: ...
37
+
38
+ **Context and environment:**
39
+
40
+ Provide any relevant information about your setup (Customize the list accordingly based on what info is relevant to this project)
41
+
42
+ 1. Version of the software the issue is being opened for.
43
+ 2. Operating System
44
+ 3. Operating System version
45
+ 4. Ruby version
46
+
47
+ _Delete any information that is not relevant._
48
+
49
+ **Logs**
50
+
51
+ Include relevant log snippets or files here.
52
+
53
+ **I will abide by the [code of conduct] (https://github.com/fastruby/skunk/blob/master/CODE_OF_CONDUCT.md)**
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: Feature request
3
+ about: Request a new feature
4
+ title: "[REQUEST]"
5
+ labels: 'enhancement'
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **IMPORTANT: please make sure you ask yourself all intro questions and fill all sections of the template.**
11
+
12
+ **Before we start...:**
13
+
14
+ - [ ] I checked the documentation and didn't find this feature
15
+ - [ ] I checked to make sure that this feature has not already been requested
16
+
17
+
18
+ **Branch/Commit:**
19
+
20
+ Inform what branch/commit/version of "Skunk" you are using.
21
+
22
+ **Describe the feature:**
23
+
24
+ Please include a detailed description of the feature you are requesting and any detail on it’s expected behavior.
25
+
26
+ > **As a \<role name\>**
27
+ > **I do \<something\>**
28
+ > **And then I do \<another action\>**
29
+ > **And I see \<some result\>**
30
+
31
+ **Problem:**
32
+
33
+ Please include a detailed description of the problem this feature would solve.
34
+
35
+ > **As a \<role name\>**
36
+ > **I want to \<do something\>**
37
+ > **So that I can achieve a \<goal\>**
38
+
39
+ **Mockups:**
40
+
41
+ Include any mockup idea related to the requested feature if it applies.
42
+
43
+ **Resources:**
44
+
45
+ If you have resources related to the implementation or research for this feature, add them here.
46
+
47
+ **I will abide by the [code of conduct](https://github.com/fastruby/skunk/blob/main/CODE_OF_CONDUCT.md)**
@@ -1,19 +1,104 @@
1
1
  # .github/workflows/ci.yml
2
2
 
3
3
  name: CI
4
- on: [push, pull_request]
4
+ on:
5
+ push:
6
+ branches:
7
+ - main
8
+ pull_request:
9
+ branches:
10
+ - main
11
+
5
12
  jobs:
6
- test:
13
+ test-ruby-2-4-x:
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - uses: actions/checkout@v1
18
+ - name: Setup Ruby
19
+ uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: 2.4
22
+ bundler-cache: true
23
+ - name: Build and run tests
24
+ env:
25
+ BUNDLE_GEMFILE: "Gemfile-Ruby-2-4"
26
+ run: |
27
+ gem install bundler
28
+ bundle install --jobs 4 --retry 3
29
+ bundle exec rake
30
+ test-ruby-2-5-x:
31
+ runs-on: ubuntu-latest
32
+
33
+ steps:
34
+ - uses: actions/checkout@v1
35
+ - name: Setup Ruby
36
+ uses: ruby/setup-ruby@v1
37
+ with:
38
+ 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:
7
46
  runs-on: ubuntu-latest
8
47
 
9
48
  steps:
10
49
  - uses: actions/checkout@v1
11
50
  - name: Setup Ruby
12
- uses: actions/setup-ruby@v1
51
+ uses: ruby/setup-ruby@v1
13
52
  with:
14
- ruby-version: 2.6.x
53
+ ruby-version: 2.6
54
+ bundler-cache: true
15
55
  - name: Build and run tests
16
56
  run: |
17
57
  gem install bundler
18
58
  bundle install --jobs 4 --retry 3
19
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
+ - name: Build and run tests
71
+ run: |
72
+ gem install bundler
73
+ bundle install --jobs 4 --retry 3
74
+ bundle exec rake
75
+ test-ruby-3-0-x:
76
+ runs-on: ubuntu-latest
77
+
78
+ steps:
79
+ - uses: actions/checkout@v1
80
+ - name: Setup Ruby
81
+ uses: ruby/setup-ruby@v1
82
+ with:
83
+ ruby-version: 3.0
84
+ bundler-cache: true
85
+ - name: Build and run tests
86
+ run: |
87
+ gem install bundler
88
+ bundle install --jobs 4 --retry 3
89
+ bundle exec rake
90
+ test-ruby-3-1-x:
91
+ runs-on: ubuntu-latest
92
+
93
+ steps:
94
+ - uses: actions/checkout@v1
95
+ - name: Setup Ruby
96
+ uses: ruby/setup-ruby@v1
97
+ with:
98
+ ruby-version: 3.1
99
+ bundler-cache: true
100
+ - name: Build and run tests
101
+ run: |
102
+ gem install bundler
103
+ bundle install --jobs 4 --retry 3
104
+ bundle exec rake
@@ -11,14 +11,19 @@ jobs:
11
11
  uses: actions/setup-ruby@v1
12
12
  with:
13
13
  ruby-version: 2.6.x
14
+ - name: Run test suite with COVERAGE=true
15
+ run: |
16
+ gem install bundler
17
+ bundle install --jobs 4 --retry 3
18
+ COVERAGE=true bundle exec rake test
14
19
  - name: Run Skunk on Project
15
20
  run: |
16
21
  gem install skunk
17
22
  CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
18
- if [[ "$CURRENT_BRANCH" -ne "master" ]]; then
23
+ if [[ "$CURRENT_BRANCH" != "main" ]]; then
19
24
  echo "Executing within branch: $CURRENT_BRANCH"
20
- skunk lib/
25
+ skunk lib/ -b master
21
26
  else
22
27
  echo "Executing within master branch"
23
- skunk lib/ -b master
28
+ skunk lib/
24
29
  fi
data/.gitignore CHANGED
@@ -6,6 +6,7 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /test/support/
9
10
 
10
11
  .byebug_history
11
12
 
data/.reek.yml CHANGED
@@ -9,14 +9,10 @@ detectors:
9
9
  - Skunk::Command::StatusReporter#table
10
10
  InstanceVariableAssumption:
11
11
  exclude:
12
- - Skunk::Cli::Command::Default
13
12
  - Skunk::Cli::Options::Argv
14
13
  - RubyCritic::AnalysedModulesCollection
15
14
  IrresponsibleModule:
16
15
  exclude:
17
- - Skunk::Cli::Command::Help
18
- - Skunk::Cli::Options::Argv
19
- - Skunk::Cli::Options
20
16
  - RubyCritic::AnalysedModulesCollection
21
17
  NestedIterators:
22
18
  exclude:
@@ -28,6 +24,6 @@ detectors:
28
24
  - Skunk::Cli::Options::Argv#parse
29
25
  UtilityFunction:
30
26
  exclude:
31
- - capture_output_streams
32
- - Skunk::Command::Compare#analyse_modified_files
33
- - Skunk::Command::Compare#build_details_path
27
+ - Skunk::Cli::Command::Compare#analyse_modified_files
28
+ - Skunk::Cli::Command::Compare#build_details_path
29
+ - Skunk::Cli::Command::Shareable#sharing?
data/.rubocop_todo.yml CHANGED
@@ -1,11 +1,19 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2019-11-09 15:45:44 -0500 using RuboCop version 0.75.1.
3
+ # on 2021-08-31 01:33:08 UTC using RuboCop version 1.9.1.
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: 2
10
+ # Configuration parameters: Include.
11
+ # Include: **/*.gemspec
12
+ Gemspec/RequiredRubyVersion:
13
+ Exclude:
14
+ - 'gemfiles/skunk.gemspec'
15
+ - 'skunk.gemspec'
16
+
9
17
  # Offense count: 1
10
18
  # Cop supports --auto-correct.
11
19
  Layout/ClosingHeredocIndentation:
@@ -14,28 +22,36 @@ Layout/ClosingHeredocIndentation:
14
22
 
15
23
  # Offense count: 1
16
24
  # Cop supports --auto-correct.
17
- # Configuration parameters: EnforcedStyle.
18
- # SupportedStyles: squiggly, active_support, powerpack, unindent
19
- Layout/IndentHeredoc:
25
+ Layout/HeredocIndentation:
20
26
  Exclude:
21
27
  - 'lib/skunk/cli/commands/status_reporter.rb'
22
28
 
23
29
  # Offense count: 2
24
- # Configuration parameters: CountComments, ExcludedMethods.
25
- # ExcludedMethods: refine
26
- Metrics/BlockLength:
27
- Max: 40
28
-
29
- # Offense count: 1
30
- # Cop supports --auto-correct.
31
- # Configuration parameters: PreferredName.
32
- Naming/RescuedExceptionsVariableName:
30
+ Lint/MissingSuper:
33
31
  Exclude:
34
32
  - 'lib/skunk/cli/application.rb'
33
+ - 'lib/skunk/cli/commands/base.rb'
34
+
35
+ # Offense count: 1
36
+ # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
37
+ Metrics/AbcSize:
38
+ Max: 18
35
39
 
36
40
  # Offense count: 7
37
- # Cop supports --auto-correct.
38
- # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
39
- # URISchemes: http, https
40
- Metrics/LineLength:
41
- Max: 96
41
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
42
+ # IgnoredMethods: refine
43
+ Metrics/BlockLength:
44
+ Max: 76
45
+
46
+ # Offense count: 2
47
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
48
+ Metrics/MethodLength:
49
+ Max: 13
50
+
51
+ # Offense count: 1
52
+ # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
53
+ # SupportedStyles: snake_case, normalcase, non_integer
54
+ # AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
55
+ Naming/VariableNumber:
56
+ Exclude:
57
+ - 'lib/skunk/cli/commands/status_sharer.rb'
data/CHANGELOG.md CHANGED
@@ -1,44 +1,67 @@
1
1
  # Changelog
2
+
2
3
  All notable changes to this project will be documented in this file.
3
4
 
4
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
7
 
7
- ## [Unreleased] [(commits)](https://github.com/fastruby/skunk/compare/v0.4.0...HEAD)
8
+ ## main [(unreleased)](https://github.com/fastruby/skunk/compare/v0.5.2...HEAD)
9
+
10
+ * <INSERT YOUR FEATURE OR BUGFIX HERE>
11
+ ## v0.5.2 / 2022-04-27 [(commits)](https://github.com/fastruby/skunk/compare/v0.5.1...v0.5.2)
12
+
13
+ * [FEATURE: Support more rubies](https://github.com/fastruby/skunk/pull/92)
14
+ * [BUGFIX: Fixed share issue with version command](https://github.com/fastruby/skunk/pull/83)
15
+ * [FEATURE: Add PR Template](https://github.com/fastruby/skunk/pull/72)
16
+ * [BUGFIX: Fix Sponsorship logo path in README](https://github.com/fastruby/skunk/pull/73)
17
+ * [BUGFIX: Test with Ruby 3.1](https://github.com/fastruby/skunk/pull/85)
18
+ * [BUGFIX: Fix changelog uri](https://github.com/fastruby/skunk/pull/90)
19
+
20
+ ## v0.5.1 / 2021-02-17 [(commits)](https://github.com/fastruby/skunk/compare/v0.5.0...v0.5.1)
21
+
22
+ * [BUGFIX: Fix bug related to compare plus share code](https://github.com/fastruby/skunk/pull/69)
23
+
24
+ ## v0.5.0 / 2020-09-18 [(commits)](https://github.com/fastruby/skunk/compare/v0.4.2...v0.5.0)
25
+
26
+ * [FEATURE: Share your results using an environment variable](https://github.com/fastruby/skunk/pull/56)
27
+ * [FEATURE: Rename the tech debt metric: StinkScore => SkunkScore. It's a little friendlier.](https://github.com/fastruby/skunk/pull/36)
28
+ * [FEATURE: Add `--out=file.txt` support to the command line](https://github.com/fastruby/skunk/pull/47)
29
+ * [BUGFIX: Skip both nested and top level spec and test folders](https://github.com/fastruby/skunk/pull/65)
30
+
31
+ ## v0.4.2 / 2020-02-09 [(commits)](https://github.com/fastruby/skunk/compare/v0.4.1...v0.4.2)
32
+
33
+ * [BUGFIX: Fixes table width issues by rounding values](https://github.com/fastruby/skunk/commit/80e2e4743bcb79619f9bb5aed9808bac1ca78231)
34
+
35
+ ## v0.4.1 / 2020-02-09 [(commits)](https://github.com/fastruby/skunk/compare/v0.4.0...v0.4.1)
36
+
37
+ * [BUGFIX: Fixes table width issues](https://github.com/fastruby/skunk/commit/372bc506f408e3647ce48b7bc149234c9da71168)
38
+
39
+ ## v0.4.0 / 2020-02-08 [(commits)](https://github.com/fastruby/skunk/compare/v0.3.2...v0.4.0)
40
+
41
+ * [FEATURE: Add `--version` support to the command line.](https://github.com/fastruby/skunk/pull/18)
42
+ * [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)
43
+ * [BUGFIX: Create compare_root_directory when it does not exist](https://github.com/fastruby/skunk/pull/23) (#12)
44
+
45
+ ## v0.3.2 / 2019-11-23 [(commits)](https://github.com/fastruby/skunk/compare/v0.3.1...v0.3.2)
46
+
47
+ * [BUGFIX: Make variable binding friendly to avoid warning](https://github.com/fastruby/skunk/pull/20)
8
48
 
9
- ## [0.4.2] [(commits)](https://github.com/fastruby/skunk/compare/v0.4.1...v0.4.2)
10
- * [BUGFIX] Fixes table width issues by rounding values (by [@etagwerker][])
49
+ ## v0.3.1 / 2019-11-19 [(commits)](https://github.com/fastruby/skunk/compare/v0.3.0...v0.3.1)
11
50
 
12
- ## [0.4.1] [(commits)](https://github.com/fastruby/skunk/compare/v0.4.0...v0.4.1)
13
- * [BUGFIX] Fixes table width issues (by [@etagwerker][])
51
+ * [BUGFIX: Change "StinkScore" formula to skip `churn_times_cost`](https://github.com/fastruby/skunk/pull/14)
14
52
 
15
- ## [0.4.0] [(commits)](https://github.com/fastruby/skunk/compare/v0.3.2...v0.4.0)
16
- * [FEATURE] Add `--version` support to the command line. (by [@bronzdoc][])
17
- * [FEATURE] Stop accepting `-p <path>` in the command line. It's redundant and it's not working anyway. (by [@etagwerker][])
18
- * [BUGFIX] Change "StinkScore" formula to skip `churn_times_cost` (by [@etagwerker][])
19
- * [BUGFIX] Fixes #12 (by [@sebastian-palma][])
53
+ ## v0.3.0 / 2019-11-19 [(commits)](https://github.com/fastruby/skunk/compare/v0.2.0...v0.3.0)
20
54
 
21
- ## [0.3.2] - 2019-11-23 [(commits)](https://github.com/fastruby/skunk/compare/v0.3.1...v0.3.2)
22
- ### Changed
23
- * [BUGFIX] Change "StinkScore" formula to skip `churn_times_cost` (by [@etagwerker][])
55
+ * [FEATURE: Added Travis CI badge to README](https://github.com/fastruby/skunk/pull/3)
56
+ * [FEATURE: Now you can compare "StinkScore" between branches](https://github.com/fastruby/skunk/pull/11)
57
+ * [BUGFIX Add contributor covenant doc](https://github.com/fastruby/skunk/commit/c765a6406f0d53043e8d1c51309d6372196e9f94)
58
+ * [BUGFIX Make sure tests work even you don't have a `coverage/.resultset.json` file](https://github.com/fastruby/skunk/pull/7)
59
+ * [BUGFIX: Make tests easier to maintain](https://github.com/fastruby/skunk/pull/10)
24
60
 
25
- ## [0.3.1] - 2019-11-19 [(commits)](https://github.com/fastruby/skunk/compare/v0.3.0...v0.3.1)
26
- ### Changed
27
- * [BUGFIX] Change "StinkScore" formula to skip `churn_times_cost` (by [@etagwerker][])
61
+ ## v0.2.0 / 2019-10-16 [(commits)](https://github.com/fastruby/skunk/compare/v0.1.0...v0.2.0)
28
62
 
29
- ## [0.3.0] - 2019-11-19 [(commits)](https://github.com/fastruby/skunk/compare/v0.2.0...v0.3.0)
30
- ### Changed
31
- * [FEATURE] Added Travis CI badge to README (by [@themayurkumbhar][])
32
- * [FEATURE] Now you can compare "StinkScore" between branches (by [@etagwerker][])
33
- * [BUGFIX] Add contributor covenant doc (by [@etagwerker][])
34
- * [BUGFIX] Make sure tests work even you don't have a `coverage/.resultset.json` file (by [@etagwerker][])
35
- * [BUGFIX] Make tests easier to maintain (by [@etagwerker][])
63
+ * [FEATURE: Now `skunk` will not report status for files that start with `test/` or `spec/`](https://github.com/fastruby/skunk/commit/6f1a3c60967abb114576e71084d80e12b0f0235f) (by
36
64
 
37
- ## [0.2.0] - 2019-10-16 [(commits)](https://github.com/fastruby/skunk/compare/v0.1.0...v0.2.0)
38
- ### Changed
39
- - [FEATURE] Now `skunk` will not report status for files that start with `test/` or `spec/` (by [@etagwerker][])
65
+ ## v0.1.0 / 2019-10-16
40
66
 
41
- ## [0.1.0] - 2019-10-16
42
- ### Added
43
- - [FEATURE] Now `skunk` uses `rubycritic-simplecov` to generate a console report with a list
44
- of files and their "StinkScore" (by [@etagwerker][])
67
+ * [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/CODEOWNERS ADDED
@@ -0,0 +1,5 @@
1
+
2
+ # These code owners will be the default owners to everything in the repository.
3
+ # Unless a posterior rule has precedence, they will be automatically requested
4
+ # for review when a pull request is opened.
5
+ * @fastruby/black-bunny-brigade
data/Gemfile-Ruby-2-4 ADDED
@@ -0,0 +1,10 @@
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 "simplecov", "< 0.19.0"
data/README.md CHANGED
@@ -1,19 +1,21 @@
1
1
  # Skunk
2
2
 
3
- [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg)](code-of-conduct.md) [![Build Status](https://travis-ci.org/fastruby/skunk.svg?branch=master)](https://travis-ci.org/fastruby/skunk) [![Maintainability](https://api.codeclimate.com/v1/badges/3e33d701ced16eee2420/maintainability)](https://codeclimate.com/github/fastruby/skunk/maintainability) [![Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/gems/skunk)
3
+ ![skunk](logo.png)
4
4
 
5
- A RubyCritic extension to calculate StinkScore for a file or project.
5
+ [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md) [![Build Status](https://travis-ci.org/fastruby/skunk.svg?branch=master)](https://travis-ci.org/fastruby/skunk) [![Maintainability](https://api.codeclimate.com/v1/badges/3e33d701ced16eee2420/maintainability)](https://codeclimate.com/github/fastruby/skunk/maintainability) [![Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/gems/skunk) [![codecov](https://codecov.io/gh/fastruby/skunk/branch/master/graph/badge.svg)](https://codecov.io/gh/fastruby/skunk)
6
6
 
7
- ## What is the StinkScore?
7
+ A RubyCritic extension to calculate SkunkScore for a file or project.
8
8
 
9
- The StinkScore is a value that assesses the technical debt of a module. It takes
9
+ ## What is the SkunkScore?
10
+
11
+ The SkunkScore is a value that assesses the technical debt of a module. It takes
10
12
  into account:
11
13
 
12
14
  - Code Complexity
13
15
  - Code Smells
14
16
  - Code Coverage
15
17
 
16
- The main goal of the StinkScore is to serve as a compass in your next
18
+ The main goal of the SkunkScore is to serve as a compass in your next
17
19
  refactoring adventure. It will help you answer these questions:
18
20
 
19
21
  - What can I do to pay off technical debt?
@@ -50,11 +52,12 @@ There are not that many options but here they are:
50
52
  skunk -h
51
53
  Usage: skunk [options] [paths]
52
54
  -b, --branch BRANCH Set branch to compare
55
+ -o, --out FILE Output report to file
53
56
  -v, --version Show gem's version
54
57
  -h, --help Show this message
55
58
  ```
56
59
 
57
- ### Getting a sorted list of stinkiest files
60
+ ### Getting a sorted list of smelly files
58
61
 
59
62
  To get the best results, make sure that you have `coverage/.resultset.json` in
60
63
  your application directory. That way `skunk` knows what's the status of your
@@ -66,7 +69,7 @@ Then simply run:
66
69
  skunk
67
70
  ```
68
71
 
69
- Then get a list of stinky files:
72
+ Then get a list of smelly files:
70
73
 
71
74
  ```
72
75
  $ skunk
@@ -86,7 +89,7 @@ running simple_cov
86
89
  .............
87
90
  New critique at file:////Users/etagwerker/Projects/fastruby/skunk/tmp/rubycritic/overview.html
88
91
  +-----------------------------------------------------+----------------------------+----------------------------+----------------------------+----------------------------+----------------------------+
89
- | file | stink_score | churn_times_cost | churn | cost | coverage |
92
+ | file | skunk_score | churn_times_cost | churn | cost | coverage |
90
93
  +-----------------------------------------------------+----------------------------+----------------------------+----------------------------+----------------------------+----------------------------+
91
94
  | lib/skunk/cli/commands/default.rb | 166.44 | 1.6643999999999999 | 3 | 0.5548 | 0 |
92
95
  | lib/skunk/cli/application.rb | 139.2 | 1.392 | 3 | 0.46399999999999997 | 0 |
@@ -103,14 +106,14 @@ New critique at file:////Users/etagwerker/Projects/fastruby/skunk/tmp/rubycritic
103
106
  | lib/skunk/cli/commands/help.rb | 0.0 | 0.0 | 2 | 0.0 | 0 |
104
107
  +-----------------------------------------------------+----------------------------+----------------------------+----------------------------+----------------------------+----------------------------+
105
108
 
106
- StinkScore Total: 612.31
109
+ SkunkScore Total: 612.31
107
110
  Modules Analysed: 13
108
- StinkScore Average: 0.47100769230769230769230769231e2
109
- Worst StinkScore: 166.44 (lib/skunk/cli/commands/default.rb)
111
+ SkunkScore Average: 0.47100769230769230769230769231e2
112
+ Worst SkunkScore: 166.44 (lib/skunk/cli/commands/default.rb)
110
113
  ```
111
114
 
112
115
  The command will run `rubycritic` and it will try to load code coverage data
113
- from your `.resultset.json` file.
116
+ from your `coverage/.resultset.json` file.
114
117
 
115
118
  Skunk's report will be in the console. Use it wisely. :)
116
119
 
@@ -122,7 +125,7 @@ Simply run:
122
125
  skunk -b <target-branch-name>
123
126
  ```
124
127
 
125
- Then get a StinkScore average comparison:
128
+ Then get a SkunkScore average comparison:
126
129
 
127
130
  ```
128
131
  $ skunk -b master
@@ -156,28 +159,63 @@ running churn
156
159
  .................
157
160
  running simple_cov
158
161
  .................
159
- Base branch (master) average stink score: 290.53999999999996
160
- Feature branch (feature/compare) average stink score: 340.3005882352941
162
+ Base branch (master) average skunk score: 290.53999999999996
163
+ Feature branch (feature/compare) average skunk score: 340.3005882352941
161
164
  Score: 340.3
162
165
  ```
163
166
 
164
167
  This should give you an idea if you're moving in the right direction or not.
165
168
 
169
+ ### Sharing results
170
+
171
+ If you want to quickly share the results of your report, you can use an
172
+ environment variable:
173
+
174
+ ```
175
+ SHARE=true skunk app/
176
+ ...
177
+ SkunkScore Total: 126.99
178
+ Modules Analysed: 17
179
+ SkunkScore Average: 7.47
180
+ Worst SkunkScore: 41.92 (lib/skunk/cli/commands/status_sharer.rb)
181
+
182
+ Generated with Skunk v0.5.0
183
+ Shared at: https://skunk.fastruby.io/k
184
+ ```
185
+
186
+ Results will be posted by default to https://skunk.fastruby.io which is a free
187
+ and open source Ruby on Rails application sponsored by
188
+ [OmbuLabs](https://www.ombulabs.com) ([source code](https://github.com/fastruby/skunk.fyi)).
189
+
190
+ If you prefer to post results to your own server, you can do so:
191
+
192
+ ```
193
+ SHARE_URL=https://path.to.your.skunk-fyi-server.example.com skunk app/
194
+ ...
195
+ SkunkScore Total: 126.99
196
+ Modules Analysed: 17
197
+ SkunkScore Average: 7.47
198
+ Worst SkunkScore: 41.92 (lib/skunk/cli/commands/status_sharer.rb)
199
+
200
+ Generated with Skunk v0.5.0
201
+ Shared at: https://path.to.your.skunk-fyi-server.example.com/k
202
+ ```
203
+
166
204
  ## Known Issues
167
205
 
168
- The StinkScore should be calculated per method. This would provide a more accurate
169
- representation of the average StinkScore in a module.
206
+ The SkunkScore should be calculated per method. This would provide a more accurate
207
+ representation of the average SkunkScore in a module.
170
208
 
171
- I think that the StinkScore of a module should be the average of the StinkScores of
209
+ I think that the SkunkScore of a module should be the average of the SkunkScores of
172
210
  all of its methods.
173
211
 
174
- Right now the StinkScore is calculated using the totals for a module:
212
+ Right now the SkunkScore is calculated using the totals for a module:
175
213
 
176
214
  - Total Code Coverage Percentage per Module
177
215
  - Total Churn per Module
178
216
  - Total Cost per Module
179
217
 
180
- For more details, feel free to review and improve this method: [RubyCritic::AnalysedModule#stink_score]
218
+ For more details, feel free to review and improve this method: [RubyCritic::AnalysedModule#skunk_score]
181
219
 
182
220
  ## Development
183
221
 
@@ -187,4 +225,20 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
187
225
 
188
226
  ## Contributing
189
227
 
190
- Bug reports and pull requests are welcome on GitHub at https://github.com/fastruby/skunk/issues.
228
+ Bug reports and pull requests are welcome on GitHub at [https://github.com/fastruby/skunk](https://github.com/fastruby/skunk). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/fastruby/skunk/blob/main/CODE_OF_CONDUCT.md).
229
+
230
+ When Submitting a Pull Request:
231
+
232
+ * If your PR closes any open GitHub issues, please include `Closes #XXXX` in your comment.
233
+
234
+ * Please include a summary of the change and which issue is fixed or which feature is introduced.
235
+
236
+ * If changes to the behavior are made, clearly describe what changes.
237
+
238
+ * If changes to the UI are made, please include screenshots of the before and after.
239
+
240
+ ## Sponsorship
241
+
242
+ ![FastRuby.io | Rails Upgrade Services](fastruby-logo.png)
243
+
244
+ `skunk` is maintained and funded by [FastRuby.io](https://fastruby.io). The names and logos for FastRuby.io are trademarks of The Lean Software Boutique LLC.
data/fastruby-logo.png ADDED
Binary file