rubocop-md 1.2.3 → 2.0.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 +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +5 -5
- data/lib/rubocop/markdown/plugin.rb +32 -0
- 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: 1d414259899409135b2608eb7744f4e27402f05ec2b065949f0c4a8b0fd8cc21
|
|
4
|
+
data.tar.gz: a9ffb768310fce686b303e10c385eab73318ec9c70af9904d0995dfef003eb85
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7e8159a8a631840d2d5d1da67606c78ddbc956bb67f7d3c1f218b89eb3a7462afc1d0e488af30d261ae2542cf722f106a394a3ae9c6643ea3529c752a0743546
|
|
7
|
+
data.tar.gz: 9a3cfdf13a58fb5130d30627ba50f69a6e4643aeb6b92b3dd0e52eb0149aafdf7f9156da2b69d3b1d2bd5e3d75ebc3a3a87f13db7bdaa6f8baf7afdfc1e816e7
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -39,23 +39,23 @@ 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
|
|
55
55
|
|
|
56
56
|
Code in the documentation does not make sense to be checked for some style guidelines (eg `Style/FrozenStringLiteralComment`).
|
|
57
57
|
|
|
58
|
-
We described such rules in the [default config](config/default.yml), but if you use the same settings in your project’s `.rubocop.yml` file, `
|
|
58
|
+
We described such rules in the [default config](config/default.yml), but if you use the same settings in your project’s `.rubocop.yml` file, `RuboCop` will override them.
|
|
59
59
|
|
|
60
60
|
Fortunately, `RuboCop` supports directory-level configuration and we can do the next trick.
|
|
61
61
|
|
|
@@ -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
|
|
|
@@ -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.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:
|
|
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:
|
|
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: []
|