skunk 0.5.1 → 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: a8741b921c9257b475b2bae0741cc039e8afef0556312667e57ba7986f10f7fa
4
- data.tar.gz: 79cc09d05f4a7ac2de50461e3ec1c9351ab68803fd33c7d9166b0d1046051891
3
+ metadata.gz: 97336bcac813e609a69fe0782edbd188a72cc24919cd5ded18b9b3515bebfecb
4
+ data.tar.gz: 94a04712f97e7e36f00aedc1d046775c565714dab38fb08e698ba6196fc1981b
5
5
  SHA512:
6
- metadata.gz: 29cd83b1f165c6e52c0196495428c80f388fd7ca7b633fe01455665632337a8a07b4bcfa26c8d29c34a23101d69ccadf858cb1615aa66812aac603850899c6df
7
- data.tar.gz: 6b22ce77d18d98dc8f53275dfde28453a5b877a9b6e30b30fe6393321daad3ae655f13502924ba42991efe4876765e0e0317dc1e1fa3c2e4b1a769ea10f01304
6
+ metadata.gz: 9996fece8b920f5de38bbd57629e9b64b78865d421a7f51011a3c63233ef60960086dfc0c73723d17bb52911b9167e624e20284cdcece502286feaa70996ee1e
7
+ data.tar.gz: 327565f1b417f77a2af14c77cb1d7d6e74057491ed154312fe189cb3997eb3526d47a6f1a73cc5600204c2aa95483f9ad117a506870128b8fcb8b85380cdca0d
@@ -87,3 +87,18 @@ jobs:
87
87
  gem install bundler
88
88
  bundle install --jobs 4 --retry 3
89
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
data/.reek.yml CHANGED
@@ -26,3 +26,4 @@ detectors:
26
26
  exclude:
27
27
  - Skunk::Cli::Command::Compare#analyse_modified_files
28
28
  - Skunk::Cli::Command::Compare#build_details_path
29
+ - Skunk::Cli::Command::Shareable#sharing?
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2021-02-12 01:27:25 UTC using RuboCop version 1.9.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
@@ -26,13 +26,6 @@ Layout/HeredocIndentation:
26
26
  Exclude:
27
27
  - 'lib/skunk/cli/commands/status_reporter.rb'
28
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'
35
-
36
29
  # Offense count: 2
37
30
  Lint/MissingSuper:
38
31
  Exclude:
@@ -48,7 +41,7 @@ Metrics/AbcSize:
48
41
  # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
49
42
  # IgnoredMethods: refine
50
43
  Metrics/BlockLength:
51
- Max: 72
44
+ Max: 76
52
45
 
53
46
  # Offense count: 2
54
47
  # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
data/CHANGELOG.md CHANGED
@@ -5,52 +5,63 @@ 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
- ## [Unreleased] [(commits)](https://github.com/fastruby/skunk/compare/v0.5.1...HEAD)
8
+ ## main [(unreleased)](https://github.com/fastruby/skunk/compare/v0.5.2...HEAD)
9
9
 
10
- ## [0.5.1] [(commits)](https://github.com/fastruby/skunk/compare/v0.5.0...v0.5.1)
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)
11
12
 
12
- * [BUGFIX] Fix bug related to compare plus share code (by [@etagwerker]())
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)
13
19
 
14
- ## [0.5.0] [(commits)](https://github.com/fastruby/skunk/compare/v0.4.2...v0.5.0)
20
+ ## v0.5.1 / 2021-02-17 [(commits)](https://github.com/fastruby/skunk/compare/v0.5.0...v0.5.1)
15
21
 
16
- * [FEATURE] Share your results using an environment variable (by [@rahulpuroht]() and [@etagwerker]())
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
+ * [BUGFIX: Fix bug related to compare plus share code](https://github.com/fastruby/skunk/pull/69)
20
23
 
21
- ## [0.4.2] [(commits)](https://github.com/fastruby/skunk/compare/v0.4.1...v0.4.2)
22
- * [BUGFIX] Fixes table width issues by rounding values (by [@etagwerker]())
24
+ ## v0.5.0 / 2020-09-18 [(commits)](https://github.com/fastruby/skunk/compare/v0.4.2...v0.5.0)
23
25
 
24
- ## [0.4.1] [(commits)](https://github.com/fastruby/skunk/compare/v0.4.0...v0.4.1)
25
- * [BUGFIX] Fixes table width issues (by [@etagwerker]())
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)
26
30
 
27
- ## [0.4.0] [(commits)](https://github.com/fastruby/skunk/compare/v0.3.2...v0.4.0)
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]())
31
+ ## v0.4.2 / 2020-02-09 [(commits)](https://github.com/fastruby/skunk/compare/v0.4.1...v0.4.2)
32
32
 
33
- ## [0.3.2] - 2019-11-23 [(commits)](https://github.com/fastruby/skunk/compare/v0.3.1...v0.3.2)
34
- ### Changed
35
- * [BUGFIX] Change "StinkScore" formula to skip `churn_times_cost` (by [@etagwerker]())
33
+ * [BUGFIX: Fixes table width issues by rounding values](https://github.com/fastruby/skunk/commit/80e2e4743bcb79619f9bb5aed9808bac1ca78231)
36
34
 
37
- ## [0.3.1] - 2019-11-19 [(commits)](https://github.com/fastruby/skunk/compare/v0.3.0...v0.3.1)
38
- ### Changed
39
- * [BUGFIX] Change "StinkScore" formula to skip `churn_times_cost` (by [@etagwerker]())
35
+ ## v0.4.1 / 2020-02-09 [(commits)](https://github.com/fastruby/skunk/compare/v0.4.0...v0.4.1)
40
36
 
41
- ## [0.3.0] - 2019-11-19 [(commits)](https://github.com/fastruby/skunk/compare/v0.2.0...v0.3.0)
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]())
37
+ * [BUGFIX: Fixes table width issues](https://github.com/fastruby/skunk/commit/372bc506f408e3647ce48b7bc149234c9da71168)
48
38
 
49
- ## [0.2.0] - 2019-10-16 [(commits)](https://github.com/fastruby/skunk/compare/v0.1.0...v0.2.0)
50
- ### Changed
51
- - [FEATURE] Now `skunk` will not report status for files that start with `test/` or `spec/` (by [@etagwerker]())
39
+ ## v0.4.0 / 2020-02-08 [(commits)](https://github.com/fastruby/skunk/compare/v0.3.2...v0.4.0)
52
40
 
53
- ## [0.1.0] - 2019-10-16
54
- ### Added
55
- - [FEATURE] Now `skunk` uses `rubycritic-simplecov` to generate a console report with a list
56
- of files and their "StinkScore" (by [@etagwerker]())
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)
48
+
49
+ ## v0.3.1 / 2019-11-19 [(commits)](https://github.com/fastruby/skunk/compare/v0.3.0...v0.3.1)
50
+
51
+ * [BUGFIX: Change "StinkScore" formula to skip `churn_times_cost`](https://github.com/fastruby/skunk/pull/14)
52
+
53
+ ## v0.3.0 / 2019-11-19 [(commits)](https://github.com/fastruby/skunk/compare/v0.2.0...v0.3.0)
54
+
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)
60
+
61
+ ## v0.2.0 / 2019-10-16 [(commits)](https://github.com/fastruby/skunk/compare/v0.1.0...v0.2.0)
62
+
63
+ * [FEATURE: Now `skunk` will not report status for files that start with `test/` or `spec/`](https://github.com/fastruby/skunk/commit/6f1a3c60967abb114576e71084d80e12b0f0235f) (by
64
+
65
+ ## v0.1.0 / 2019-10-16
66
+
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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Skunk
2
2
 
3
- ![skunk](https://github.com/fastruby/skunk/raw/master/logo.png)
3
+ ![skunk](logo.png)
4
4
 
5
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
 
@@ -225,10 +225,20 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
225
225
 
226
226
  ## Contributing
227
227
 
228
- 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.
229
239
 
230
240
  ## Sponsorship
231
241
 
232
- ![FastRuby.io | Rails Upgrade Services](https://github.com/fastruby/skunk/raw/master/fastruby-logo.png)
242
+ ![FastRuby.io | Rails Upgrade Services](fastruby-logo.png)
233
243
 
234
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 CHANGED
Binary file
@@ -30,8 +30,10 @@ module Skunk
30
30
  reporter = command.execute
31
31
 
32
32
  print(reporter.status_message)
33
- share_status_message = command.share(reporter)
34
- print(share_status_message)
33
+ if command.sharing?
34
+ share_status_message = command.share(reporter)
35
+ print(share_status_message)
36
+ end
35
37
 
36
38
  reporter.status
37
39
  rescue OptionParser::InvalidOption => e
@@ -14,6 +14,10 @@ module Skunk
14
14
  status_reporter
15
15
  end
16
16
 
17
+ def sharing?
18
+ false
19
+ end
20
+
17
21
  private
18
22
 
19
23
  attr_reader :options, :status_reporter
@@ -15,6 +15,12 @@ module Skunk
15
15
  sharer.status_reporter = reporter
16
16
  sharer.share
17
17
  end
18
+
19
+ # @return [Boolean] If the environment is set to share to an external
20
+ # service
21
+ def sharing?
22
+ ENV["SHARE"] == "true"
23
+ end
18
24
  end
19
25
  end
20
26
  end
@@ -75,7 +75,7 @@ TEMPL
75
75
  width = max.pathname.to_s.length + HEADINGS_WITHOUT_FILE_WIDTH
76
76
  {
77
77
  style: {
78
- width: width
78
+ width: width # rubocop:disable Style/HashSyntax
79
79
  }
80
80
  }
81
81
  end
@@ -38,6 +38,7 @@ module Skunk
38
38
  ENV["SHARE_URL"] || DEFAULT_URL
39
39
  end
40
40
 
41
+ # rubocop:disable Style/HashSyntax
41
42
  def json_summary
42
43
  result = {
43
44
  total_skunk_score: total_skunk_score,
@@ -55,6 +56,7 @@ module Skunk
55
56
 
56
57
  result
57
58
  end
59
+ # rubocop:enable Style/HashSyntax
58
60
 
59
61
  def json_results
60
62
  sorted_modules.map(&:to_hash)
@@ -4,12 +4,18 @@ require "rubycritic/commands/version"
4
4
 
5
5
  # nodoc #
6
6
  module Skunk
7
- module Command
8
- # Shows skunk version
9
- class Version < RubyCritic::Command::Version
10
- def execute
11
- print Skunk::VERSION
12
- status_reporter
7
+ module Cli
8
+ module Command
9
+ # Shows skunk version
10
+ class Version < RubyCritic::Command::Version
11
+ def execute
12
+ print Skunk::VERSION
13
+ status_reporter
14
+ end
15
+
16
+ def sharing?
17
+ false
18
+ end
13
19
  end
14
20
  end
15
21
  end
@@ -37,7 +37,7 @@ module Skunk
37
37
  end
38
38
 
39
39
  def to_h
40
- super.merge(output_filename: output_filename)
40
+ super.merge(output_filename: output_filename) # rubocop:disable Style/HashSyntax
41
41
  end
42
42
  end
43
43
  end
@@ -53,6 +53,7 @@ module RubyCritic
53
53
  # - coverage
54
54
  #
55
55
  # @return [Hash]
56
+ # rubocop:disable Style/HashSyntax
56
57
  def to_hash
57
58
  {
58
59
  file: pathname.to_s,
@@ -63,5 +64,6 @@ module RubyCritic
63
64
  coverage: coverage.round(2)
64
65
  }
65
66
  end
67
+ # rubocop:enable Style/HashSyntax
66
68
  end
67
69
  end
data/lib/skunk/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Skunk
4
- VERSION = "0.5.1"
4
+ VERSION = "0.5.2"
5
5
  end
@@ -0,0 +1,11 @@
1
+ **IMPORTANT**: Please read the README before submitting pull requests for this project. Additionally, if your PR closes any open GitHub issue, make sure you include Closes #XXXX in your comment.
2
+
3
+ - [ ] Add an entry to `CHANGELOG.md` that links to this PR under the "main (unreleased)" heading.
4
+
5
+ Description:
6
+
7
+ Please include a summary of the change and which issue is fixed or which feature is introduced.
8
+
9
+ If changes to the behavior are made, clearly describe what changes.
10
+
11
+ I will abide by the [code of conduct](https://github.com/fastruby/skunk/blob/main/CODE_OF_CONDUCT.md).
data/skunk.gemspec CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.description = "Knows how to calculate the SkunkScore for a set of Ruby modules"
15
15
  spec.homepage = "https://github.com/fastruby/skunk"
16
16
 
17
- spec.required_ruby_version = [">= 2.4.0", "< 3.1.0"]
17
+ spec.required_ruby_version = [">= 2.4.0", "< 3.2"]
18
18
 
19
19
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
20
20
  # to allow pushing to a single host or delete this section to allow pushing to any host.
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.metadata["homepage_uri"] = spec.homepage
25
25
  spec.metadata["source_code_uri"] = "https://github.com/fastruby/skunk"
26
- spec.metadata["changelog_uri"] = "https://github.com/fastruby/skunk/changelog"
26
+ spec.metadata["changelog_uri"] = "https://github.com/fastruby/skunk/blob/main/CHANGELOG.md"
27
27
  else
28
28
  raise "RubyGems 2.0 or newer is required to protect against " \
29
29
  "public gem pushes."
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skunk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernesto Tagwerker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-18 00:00:00.000000000 Z
11
+ date: 2022-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubycritic
@@ -271,6 +271,7 @@ files:
271
271
  - lib/skunk/rubycritic/analysed_modules_collection.rb
272
272
  - lib/skunk/version.rb
273
273
  - logo.png
274
+ - pull_request_template.md
274
275
  - samples/engines/spec/nested_sample_spec.rb
275
276
  - samples/rubycritic/analysed_module.rb
276
277
  - skunk.gemspec
@@ -281,7 +282,7 @@ metadata:
281
282
  allowed_push_host: https://www.rubygems.org
282
283
  homepage_uri: https://github.com/fastruby/skunk
283
284
  source_code_uri: https://github.com/fastruby/skunk
284
- changelog_uri: https://github.com/fastruby/skunk/changelog
285
+ changelog_uri: https://github.com/fastruby/skunk/blob/main/CHANGELOG.md
285
286
  post_install_message:
286
287
  rdoc_options: []
287
288
  require_paths:
@@ -293,14 +294,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
293
294
  version: 2.4.0
294
295
  - - "<"
295
296
  - !ruby/object:Gem::Version
296
- version: 3.1.0
297
+ version: '3.2'
297
298
  required_rubygems_version: !ruby/object:Gem::Requirement
298
299
  requirements:
299
300
  - - ">="
300
301
  - !ruby/object:Gem::Version
301
302
  version: '0'
302
303
  requirements: []
303
- rubygems_version: 3.0.9
304
+ rubygems_version: 3.3.3
304
305
  signing_key:
305
306
  specification_version: 4
306
307
  summary: A library to assess code quality vs. code coverage