skunk 0.5.2 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +12 -92
- data/.github/workflows/skunk.yml +4 -3
- data/.gitignore +1 -0
- data/.reek.yml +4 -3
- data/.rubocop_todo.yml +25 -17
- data/CHANGELOG.md +18 -1
- data/CONTRIBUTING.md +84 -0
- data/Gemfile +4 -0
- data/README.md +108 -156
- data/lib/skunk/cli/application.rb +3 -3
- data/lib/skunk/cli/options/argv.rb +1 -1
- data/lib/skunk/command_factory.rb +25 -0
- data/lib/skunk/commands/base.rb +21 -0
- data/lib/skunk/commands/compare.rb +64 -0
- data/lib/skunk/commands/compare_score.rb +39 -0
- data/lib/skunk/commands/default.rb +48 -0
- data/lib/skunk/commands/help.rb +25 -0
- data/lib/skunk/commands/shareable.rb +25 -0
- data/lib/skunk/{cli/commands → commands}/status_reporter.rb +1 -1
- data/lib/skunk/{cli/commands → commands}/status_sharer.rb +1 -3
- data/lib/skunk/commands/version.rb +20 -0
- data/lib/skunk/generators/json/simple.rb +58 -0
- data/lib/skunk/generators/json_report.rb +23 -0
- data/lib/skunk/reporter.rb +25 -0
- data/lib/skunk/rubycritic/analysed_module.rb +15 -9
- data/lib/skunk/version.rb +1 -1
- data/skunk.gemspec +6 -7
- metadata +40 -55
- data/CODEOWNERS +0 -5
- data/Gemfile-Ruby-2-4 +0 -10
- 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 -27
- data/lib/skunk/cli/commands/shareable.rb +0 -27
- data/lib/skunk/cli/commands/version.rb +0 -22
- /data/lib/skunk/{cli/commands → commands}/output.rb +0 -0
@@ -1,49 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "rubycritic/commands/default"
|
4
|
-
require "rubycritic/analysers_runner"
|
5
|
-
require "rubycritic/revision_comparator"
|
6
|
-
require "rubycritic/reporter"
|
7
|
-
|
8
|
-
require "skunk/cli/commands/base"
|
9
|
-
require "skunk/cli/commands/shareable"
|
10
|
-
require "skunk/cli/commands/status_reporter"
|
11
|
-
|
12
|
-
module Skunk
|
13
|
-
module Cli
|
14
|
-
module Command
|
15
|
-
# Default command runs a critique using RubyCritic and uses
|
16
|
-
# Skunk::Command::StatusReporter to report status
|
17
|
-
class Default < RubyCritic::Command::Default
|
18
|
-
include Skunk::Cli::Command::Shareable
|
19
|
-
|
20
|
-
def initialize(options)
|
21
|
-
super
|
22
|
-
@options = options
|
23
|
-
@status_reporter = Skunk::Command::StatusReporter.new(options)
|
24
|
-
end
|
25
|
-
|
26
|
-
# It generates a report and it returns an instance of
|
27
|
-
# Skunk::Command::StatusReporter
|
28
|
-
#
|
29
|
-
# @return [Skunk::Command::StatusReporter]
|
30
|
-
def execute
|
31
|
-
RubyCritic::Config.formats = []
|
32
|
-
|
33
|
-
report(critique)
|
34
|
-
|
35
|
-
status_reporter
|
36
|
-
end
|
37
|
-
|
38
|
-
# It connects the Skunk::Command::StatusReporter with the collection
|
39
|
-
# of analysed modules.
|
40
|
-
#
|
41
|
-
# @param [RubyCritic::AnalysedModulesCollection] A collection of analysed modules
|
42
|
-
def report(analysed_modules)
|
43
|
-
status_reporter.analysed_modules = analysed_modules
|
44
|
-
status_reporter.score = analysed_modules.score
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "skunk/cli/commands/base"
|
4
|
-
require "rubycritic/commands/help"
|
5
|
-
|
6
|
-
module Skunk
|
7
|
-
module Cli
|
8
|
-
module Command
|
9
|
-
# Knows how to guide user into using `skunk` properly
|
10
|
-
class Help < Skunk::Cli::Command::Base
|
11
|
-
# Outputs a help message
|
12
|
-
def execute
|
13
|
-
puts options[:help_text]
|
14
|
-
status_reporter
|
15
|
-
end
|
16
|
-
|
17
|
-
def sharing?
|
18
|
-
false
|
19
|
-
end
|
20
|
-
|
21
|
-
private
|
22
|
-
|
23
|
-
attr_reader :options, :status_reporter
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Skunk
|
4
|
-
module Cli
|
5
|
-
module Command
|
6
|
-
# This is a module that will be used for sharing reports to a server
|
7
|
-
module Shareable
|
8
|
-
# It shares the report using SHARE_URL or https://skunk.fastruby.io. It
|
9
|
-
# will post all results in JSON format and return a status message.
|
10
|
-
#
|
11
|
-
# @param [Skunk::Command::StatusReporter] A status reporter with analysed modules
|
12
|
-
# :reek:FeatureEnvy
|
13
|
-
def share(reporter)
|
14
|
-
sharer = Skunk::Command::StatusSharer.new(@options)
|
15
|
-
sharer.status_reporter = reporter
|
16
|
-
sharer.share
|
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
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "rubycritic/commands/version"
|
4
|
-
|
5
|
-
# nodoc #
|
6
|
-
module Skunk
|
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
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
File without changes
|