rubocop-md 1.2.4 → 2.0.1

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: 62c192c00a24695544108e88c6d66c9de0216457dfb6516731fcdd0d9d456c29
4
- data.tar.gz: 87d380ab217bcb15a137fe65342c003d73247bd33f1ed8afd0c1b1961d35f8ae
3
+ metadata.gz: 39515a566265c94625d4830a0cc2d32d33ea28b7c4bf468d16eb187a2b4b151b
4
+ data.tar.gz: cc517ef20a2309bc776616168cae00a5b4e56ca9bc19422b9765583db7926614
5
5
  SHA512:
6
- metadata.gz: 7e9f8ebc5ec8cfcbbc652b712630ad9be5b0b047447f843a43b3aa29e9119bb951b619992f95be68f231300296fc2036019a82a3b7e44d472fbf1662262d86e9
7
- data.tar.gz: 5955808a8f1320dec6c18be33104cf6550f36db71e1d5b0f350d211a9e9be179815c3f50b1d118a90bd61c8ba5c43b6d36a449d596e57f37a60883dad483a896
6
+ metadata.gz: c93d26665db7f0d69a96daf711d92646677da5fb0e941b7e5aec3ee426917b8e2aa2d4ade27c02d769ef108d0dcdfa5d4be23ffde32a06248a3fad6c065c3ee1
7
+ data.tar.gz: baa5d02854f6eff663f91a7c84e4d5bba1323eee306fed09f2f44fd01e3c6dcbc2093875970e6ae0d728de3c0e3e87c758e18a574e701adff931388deef709c5
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 2.0.1 (2025-04-14)
6
+
7
+ - Remove `Layout/TrailingBlankLines`.
8
+
9
+ ## 2.0.0 (2025-02-17)
10
+
11
+ - Migrate to new RuboCop Plugin architecture.
12
+
5
13
  ## 1.2.4 (2024-10-16)
6
14
 
7
15
  - Fix RuboCop warnings.
data/README.md CHANGED
@@ -39,16 +39,16 @@ Or install it yourself as:
39
39
 
40
40
  ### Command line
41
41
 
42
- Just require `rubocop-md` in your command:
42
+ Just require `rubocop-md` plugin in your command:
43
43
 
44
44
  ```sh
45
- rubocop -r "rubocop-md" ./lib
45
+ rubocop --plugin "rubocop-md" ./lib
46
46
  ```
47
47
 
48
48
  Autocorrect works too:
49
49
 
50
50
  ```sh
51
- rubocop -r "rubocop-md" -a ./lib
51
+ rubocop --plugin "rubocop-md" -a ./lib
52
52
  ```
53
53
 
54
54
  ### Configuration
@@ -64,7 +64,7 @@ At first, add `rubocop-md` to your main `.rubocop.yml`:
64
64
  ```yml
65
65
  # .rubocop.yml
66
66
 
67
- require:
67
+ plugins:
68
68
  - "rubocop-md"
69
69
  ```
70
70
 
data/config/default.yml CHANGED
@@ -25,9 +25,6 @@ Layout/CommentIndentation: &markdown_excludes
25
25
  Layout/LeadingCommentSpace:
26
26
  <<: *markdown_excludes
27
27
 
28
- Layout/TrailingBlankLines:
29
- <<: *markdown_excludes
30
-
31
28
  Layout/TrailingEmptyLines:
32
29
  <<: *markdown_excludes
33
30
 
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lint_roller"
4
+
5
+ module RuboCop
6
+ module Markdown
7
+ # A plugin that integrates rubocop-md with RuboCop's plugin system.
8
+ class Plugin < LintRoller::Plugin
9
+ def about
10
+ LintRoller::About.new(
11
+ name: "rubocop-md",
12
+ version: VERSION,
13
+ homepage: "https://github.com/rubocop/rubocop-md",
14
+ description: "Run RuboCop against your Markdown files to make sure " \
15
+ "that code examples follow style guidelines."
16
+ )
17
+ end
18
+
19
+ def supported?(context)
20
+ context.engine == :rubocop
21
+ end
22
+
23
+ def rules(_context)
24
+ LintRoller::Rules.new(
25
+ type: :path,
26
+ config_format: :rubocop,
27
+ value: Pathname.new(__dir__).join("../../../config/default.yml")
28
+ )
29
+ end
30
+ end
31
+ end
32
+ end
@@ -46,7 +46,7 @@ module RuboCop
46
46
  end
47
47
 
48
48
  def restore!(src)
49
- src.gsub!(/^##{MARKER}/m, "")
49
+ src.gsub!(/^#\s*#{MARKER}/m, "")
50
50
  end
51
51
  end
52
52
 
@@ -24,17 +24,6 @@ module RuboCop
24
24
  class << self
25
25
  attr_accessor :config_store
26
26
 
27
- # Merge markdown config into default configuration
28
- # See https://github.com/backus/rubocop-rspec/blob/master/lib/rubocop/rspec/inject.rb
29
- def inject!
30
- path = CONFIG_DEFAULT.to_s
31
- hash = ConfigLoader.send(:load_yaml_configuration, path)
32
- config = Config.new(hash, path)
33
- puts "configuration from #{path}" if ConfigLoader.debug?
34
- config = ConfigLoader.merge_with_default(config, path)
35
- ConfigLoader.instance_variable_set(:@default_configuration, config)
36
- end
37
-
38
27
  def markdown_file?(file)
39
28
  MARKDOWN_EXTENSIONS.include?(File.extname(file))
40
29
  end
@@ -42,8 +31,6 @@ module RuboCop
42
31
  end
43
32
  end
44
33
 
45
- RuboCop::Markdown.inject!
46
-
47
34
  RuboCop::Runner.prepend(Module.new do
48
35
  # Set config store for Markdown
49
36
  def get_processed_source(*args)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module Markdown
5
- VERSION = "1.2.4"
5
+ VERSION = "2.0.1"
6
6
  end
7
7
  end
@@ -11,5 +11,6 @@ module RuboCop
11
11
 
12
12
  require_relative "markdown/preprocess"
13
13
  require_relative "markdown/rubocop_ext" if defined?(::RuboCop::ProcessedSource)
14
+ require_relative "markdown/plugin"
14
15
  end
15
16
  end
metadata CHANGED
@@ -1,29 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-md
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Dementyev
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-17 00:00:00.000000000 Z
11
+ date: 2025-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: lint_roller
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.1'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rubocop
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - ">="
18
32
  - !ruby/object:Gem::Version
19
- version: '1.45'
33
+ version: 1.72.1
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
38
  - - ">="
25
39
  - !ruby/object:Gem::Version
26
- version: '1.45'
40
+ version: 1.72.1
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -66,7 +80,7 @@ dependencies:
66
80
  - - "~>"
67
81
  - !ruby/object:Gem::Version
68
82
  version: '5.0'
69
- description: Run Rubocop against your Markdown files to make sure that code examples
83
+ description: Run RuboCop against your Markdown files to make sure that code examples
70
84
  follow style guidelines.
71
85
  email:
72
86
  - dementiev.vm@gmail.com
@@ -80,6 +94,7 @@ files:
80
94
  - config/default.yml
81
95
  - lib/rubocop-md.rb
82
96
  - lib/rubocop/markdown.rb
97
+ - lib/rubocop/markdown/plugin.rb
83
98
  - lib/rubocop/markdown/preprocess.rb
84
99
  - lib/rubocop/markdown/rubocop_ext.rb
85
100
  - lib/rubocop/markdown/version.rb
@@ -92,7 +107,8 @@ metadata:
92
107
  documentation_uri: https://github.com/rubocop/rubocop-md/blob/master/README.md
93
108
  homepage_uri: https://github.com/rubocop/rubocop-md
94
109
  source_code_uri: http://github.com/rubocop/rubocop-md
95
- post_install_message:
110
+ default_lint_roller_plugin: RuboCop::Markdown::Plugin
111
+ post_install_message:
96
112
  rdoc_options: []
97
113
  require_paths:
98
114
  - lib
@@ -100,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
100
116
  requirements:
101
117
  - - ">="
102
118
  - !ruby/object:Gem::Version
103
- version: 2.6.0
119
+ version: 2.7.0
104
120
  required_rubygems_version: !ruby/object:Gem::Requirement
105
121
  requirements:
106
122
  - - ">="
@@ -108,8 +124,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
124
  version: '0'
109
125
  requirements: []
110
126
  rubygems_version: 3.4.19
111
- signing_key:
127
+ signing_key:
112
128
  specification_version: 4
113
- summary: Run Rubocop against your Markdown files to make sure that code examples follow
129
+ summary: Run RuboCop against your Markdown files to make sure that code examples follow
114
130
  style guidelines.
115
131
  test_files: []