rubocop-md 2.0.3 → 2.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f56c2e750c470680a47ab5bad0f47ad23774d9908baaa2bf28a1ee8ef3ebcd9d
4
- data.tar.gz: 2a7dcc1e71b22f8dc50f5c63b02a7b215e3ca8737659950801e8763a4f56783a
3
+ metadata.gz: c3daa631b2f266f022b572d333bca39c035fca85c6cd3616c855f3cd796f04f7
4
+ data.tar.gz: 3e78b24aee5905d444d632d7ff92f348f1ad6bbf1c8747a0c149be1373ec8a6f
5
5
  SHA512:
6
- metadata.gz: 3dcfe1bbf135e5d7bf8452580dca696bca8ee490395bb429fea973c5c68c7e1f7e59fd4912e38814343a73c623714d0342fa5515e5e7f269690792471069c258
7
- data.tar.gz: e63dfd019f828af567b8b003cb0ac158e9eb40f4d5ffcc1b57f2447e263b470a9a4f1cc7a26e66f20bc7bba6585646f2f1355c62f39aaf81622352678f6488a6
6
+ metadata.gz: 02ed290d0f3cbfcb6d8a28f762ff7ee9d2382f391b1b6464a57f9354cbd481cfe8967bd4e1274b70ed97c1526832029efe8e4a997f7477dc3b2256c2e67e54dd
7
+ data.tar.gz: cd2fdbe1a09b41dcf83ca2aa63edb827adfae08259c9a48b6a21e59710a8c0feffd9ec3ed7e418eb720904764e5ca69f69855ba9eadaae1b42d6a61ef66e7a3b
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 2.0.4 (2026-01-28)
6
+
7
+ - Enable caching when no offenses detected.
8
+
5
9
  ## 2.0.3 (2025-09-30)
6
10
 
7
11
  - Fix compatibility with RuboCop upstream (`get_processed_source` signature)
@@ -39,13 +39,33 @@ RuboCop::Runner.prepend(Module.new do
39
39
  super
40
40
  end
41
41
 
42
- # Do not cache markdown files, 'cause cache doesn't know about processing.
42
+ # Only cache markdown files if they have no offenses, 'cause cache doesn't know about processing.
43
43
  # NOTE: we should involve preprocessing in RuboCop::CachedData#deserialize_offenses
44
+ # rubocop:disable Metrics/MethodLength, Metrics/PerceivedComplexity
44
45
  def file_offense_cache(file, ...)
45
- return yield if RuboCop::Markdown.markdown_file?(file)
46
+ if cached_run? && RuboCop::Markdown.markdown_file?(file)
47
+ config = @config_store.for_file(file)
48
+ cache = cached_result(file, standby_team(config))
46
49
 
47
- super
50
+ if cache&.valid?
51
+ offenses = cache.load
52
+
53
+ real_run_needed = offenses.any?
54
+ else
55
+ real_run_needed = true
56
+ end
57
+
58
+ if real_run_needed
59
+ offenses = yield
60
+ save_in_cache(cache, offenses) if offenses.empty?
61
+ end
62
+
63
+ offenses
64
+ else
65
+ super
66
+ end
48
67
  end
68
+ # rubocop:enable Metrics/MethodLength, Metrics/PerceivedComplexity
49
69
 
50
70
  def file_finished(file, offenses, ...)
51
71
  return super unless RuboCop::Markdown.markdown_file?(file)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module Markdown
5
- VERSION = "2.0.3"
5
+ VERSION = "2.0.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-md
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Dementyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-09-30 00:00:00.000000000 Z
11
+ date: 2026-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lint_roller