rubocop-md 1.2.4 → 2.0.0

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: 62c192c00a24695544108e88c6d66c9de0216457dfb6516731fcdd0d9d456c29
4
- data.tar.gz: 87d380ab217bcb15a137fe65342c003d73247bd33f1ed8afd0c1b1961d35f8ae
3
+ metadata.gz: 1d414259899409135b2608eb7744f4e27402f05ec2b065949f0c4a8b0fd8cc21
4
+ data.tar.gz: a9ffb768310fce686b303e10c385eab73318ec9c70af9904d0995dfef003eb85
5
5
  SHA512:
6
- metadata.gz: 7e9f8ebc5ec8cfcbbc652b712630ad9be5b0b047447f843a43b3aa29e9119bb951b619992f95be68f231300296fc2036019a82a3b7e44d472fbf1662262d86e9
7
- data.tar.gz: 5955808a8f1320dec6c18be33104cf6550f36db71e1d5b0f350d211a9e9be179815c3f50b1d118a90bd61c8ba5c43b6d36a449d596e57f37a60883dad483a896
6
+ metadata.gz: 7e8159a8a631840d2d5d1da67606c78ddbc956bb67f7d3c1f218b89eb3a7462afc1d0e488af30d261ae2542cf722f106a394a3ae9c6643ea3529c752a0743546
7
+ data.tar.gz: 9a3cfdf13a58fb5130d30627ba50f69a6e4643aeb6b92b3dd0e52eb0149aafdf7f9156da2b69d3b1d2bd5e3d75ebc3a3a87f13db7bdaa6f8baf7afdfc1e816e7
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 2.0.0 (2025-02-17)
6
+
7
+ - Migrate to new RuboCop Plugin architecture.
8
+
5
9
  ## 1.2.4 (2024-10-16)
6
10
 
7
11
  - 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
 
@@ -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
@@ -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.0"
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.0
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-02-17 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: []