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 +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +4 -4
- data/config/default.yml +0 -3
- data/lib/rubocop/markdown/plugin.rb +32 -0
- data/lib/rubocop/markdown/preprocess.rb +1 -1
- data/lib/rubocop/markdown/rubocop_ext.rb +0 -13
- data/lib/rubocop/markdown/version.rb +1 -1
- data/lib/rubocop/markdown.rb +1 -0
- metadata +26 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39515a566265c94625d4830a0cc2d32d33ea28b7c4bf468d16eb187a2b4b151b
|
4
|
+
data.tar.gz: cc517ef20a2309bc776616168cae00a5b4e56ca9bc19422b9765583db7926614
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c93d26665db7f0d69a96daf711d92646677da5fb0e941b7e5aec3ee426917b8e2aa2d4ade27c02d769ef108d0dcdfa5d4be23ffde32a06248a3fad6c065c3ee1
|
7
|
+
data.tar.gz: baa5d02854f6eff663f91a7c84e4d5bba1323eee306fed09f2f44fd01e3c6dcbc2093875970e6ae0d728de3c0e3e87c758e18a574e701adff931388deef709c5
|
data/CHANGELOG.md
CHANGED
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
|
45
|
+
rubocop --plugin "rubocop-md" ./lib
|
46
46
|
```
|
47
47
|
|
48
48
|
Autocorrect works too:
|
49
49
|
|
50
50
|
```sh
|
51
|
-
rubocop
|
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
|
-
|
67
|
+
plugins:
|
68
68
|
- "rubocop-md"
|
69
69
|
```
|
70
70
|
|
data/config/default.yml
CHANGED
@@ -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)
|
data/lib/rubocop/markdown.rb
CHANGED
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:
|
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:
|
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:
|
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:
|
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
|
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
|
-
|
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.
|
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
|
129
|
+
summary: Run RuboCop against your Markdown files to make sure that code examples follow
|
114
130
|
style guidelines.
|
115
131
|
test_files: []
|