goodcheck 3.0.3 → 3.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b382336bf78153607e3951bdafe7d819ebac80b080df118fcf3c2b15a25040db
4
- data.tar.gz: b17ec056b4d49b70d777a90142b40dd4d17dcb50d9e5861f88cdb37c0eaeff0e
3
+ metadata.gz: c52f33a7ac472299ab9acdfe418c10f14d7e36c1d709118484ed89bc4c336597
4
+ data.tar.gz: 9b2021e6127d5f4d5892ac248b04d612ee88d6efb2e0237d54e3e17a25b5ab67
5
5
  SHA512:
6
- metadata.gz: 5eaa08336a26a7adb83a0100dd48937395b11a3ee0da758a869940d0e741fa515c5eabc9bef9bf6f6eb1d39d69141014e5c64b0868594fb2bf983ccec7f203c9
7
- data.tar.gz: 52a89b2342b9d6785d7ecfb847174d36cccba6bbd33c073520dcc4f65569a2579fb0879e59048aa41de8cd5cd00bc1b07c95784fe53f4b2ed2e1cb05417b4ff8
6
+ metadata.gz: eb9085ae8573a2c07a29e7a75f0dd3f3b56340e1cde25ff10fb369c4eb4f1592f3101fc7bcb93a596d2a69fe3b69e0b4e2d35a81cbf65624fa4d471e7853e42e
7
+ data.tar.gz: 4eb596ffc6d63a26ef61b3b437b363eb517ff4d0923973b484b587ef39026475d927a408f9ab33c29eb72b207f072d844a12135a96dbd3040be9c5f73a8cf2d4
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## HEAD
4
4
 
5
+ ## 3.1.0 (2021-07-15)
6
+
7
+ * Improve coloring for text format [#208](https://github.com/sider/goodcheck/pull/208)
8
+ * Output justification with text format [#210](https://github.com/sider/goodcheck/pull/210)
9
+
5
10
  ## 3.0.3 (2021-06-25)
6
11
 
7
12
  * Fix HTTP GET retrying [#203](https://github.com/sider/goodcheck/pull/203)
data/README.md CHANGED
@@ -37,12 +37,12 @@ To install this gem onto your local machine, run `bundle exec rake install`.
37
37
 
38
38
  To release a new version, follows the steps below:
39
39
 
40
- 1. Update the version number in [`version.rb`](lib/goodcheck/version.rb).
41
- 2. Add the new version's entry to the [changelog](CHANGELOG.md).
42
- 3. Update the documentation via `bundle exec rake docs:update_version`.
43
- 4. Commit the above changes like `git commit -m 'Version 1.2.3'`.
44
- 5. Run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
45
- 6. Publish the updated documentation like `GIT_USER=some_user [USE_SSH=true] bundle exec rake docs:publish`.
40
+ 1. Update [`lib/goodcheck/version.rb`](lib/goodcheck/version.rb).
41
+ 2. Update [CHANGELOG.md](CHANGELOG.md).
42
+ 3. Run `bundle exec rake docs:update_version`.
43
+ 4. Run `git add . && git commit -m 'Version <new_version>'`.
44
+ 5. Run `bundle exec rake release`, which will create a tag, push the commit and tag, and publish the gem to [RubyGems.org](https://rubygems.org).
45
+ 6. Run `GIT_USER=<your_nickname> [USE_SSH=true] bundle exec rake docs:publish`.
46
46
 
47
47
  ## Contributing
48
48
 
@@ -25,7 +25,16 @@ module Goodcheck
25
25
  def issue(issue)
26
26
  @issue_count += 1
27
27
 
28
- message = issue.rule.message.lines.first.chomp
28
+ format_line = lambda do |line:, column:|
29
+ format_args = {
30
+ path: Rainbow(issue.path).cyan,
31
+ location: Rainbow(":#{line}:#{column}:").dimgray,
32
+ message: issue.rule.message.lines.first.chomp,
33
+ rule: Rainbow("(#{issue.rule.id})").dimgray,
34
+ severity: issue.rule.severity ? Rainbow("[#{issue.rule.severity}]").magenta : ""
35
+ }
36
+ format("%<path>s%<location>s %<message>s %<rule>s %<severity>s", format_args).strip
37
+ end
29
38
 
30
39
  if issue.location
31
40
  start_line = issue.location.start_line
@@ -37,13 +46,21 @@ module Goodcheck
37
46
  else
38
47
  line.bytesize - start_column
39
48
  end
40
- rule = Rainbow("(#{issue.rule.id})").darkgray
41
- severity = issue.rule.severity ? Rainbow("[#{issue.rule.severity}]").magenta : ""
42
- stdout.puts "#{Rainbow(issue.path).cyan}:#{start_line}:#{start_column}: #{message} #{rule} #{severity}".strip
49
+ stdout.puts format_line.call(line: start_line, column: start_column)
43
50
  stdout.puts line.chomp
44
51
  stdout.puts (" " * start_column_index) + Rainbow("^" + "~" * (column_size - 1)).yellow
45
52
  else
46
- stdout.puts "#{Rainbow(issue.path).cyan}:-:-: #{message}"
53
+ stdout.puts format_line.call(line: "-", column: "-")
54
+ end
55
+
56
+ justifications = issue.rule.justifications
57
+ unless justifications.empty?
58
+ stdout.puts ""
59
+ stdout.puts " #{Rainbow('Justifications').dimgray.underline.italic}:"
60
+ justifications.each do |justification|
61
+ stdout.puts " • #{Rainbow(justification).dimgray.italic}"
62
+ end
63
+ stdout.puts ""
47
64
  end
48
65
  end
49
66
 
@@ -1,3 +1,3 @@
1
1
  module Goodcheck
2
- VERSION = "3.0.3".freeze
2
+ VERSION = "3.1.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: goodcheck
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sider Corporation
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-25 00:00:00.000000000 Z
11
+ date: 2021-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -209,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
209
  - !ruby/object:Gem::Version
210
210
  version: '0'
211
211
  requirements: []
212
- rubygems_version: 3.2.21
212
+ rubygems_version: 3.2.23
213
213
  signing_key:
214
214
  specification_version: 4
215
215
  summary: Regexp based customizable linter.