rubocop-md 1.2.0 → 1.2.1

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: 481459568a982c49d109a7514bc891f22acf485a22954372eae24fb94e7543bc
4
- data.tar.gz: 9af60abc5f0fc512eeeba617cf52b12ce471db0ff0b39e452f2e5ac246dad51a
3
+ metadata.gz: 8e4b62aa5ac22f5dd82b132acd7439582c1d7e4a925d8a44cfeb48f250d579aa
4
+ data.tar.gz: 5acca30ab4a740b8bb9fdd25bd1b769f96504a63c8f6e4d3460ddfe61c66dbcf
5
5
  SHA512:
6
- metadata.gz: 8f7b69a5a9bb3aec08882635b3746ed6aececc5c485b3d228564c66bc41fbb06935b1574b69027fb18c7fdd1c6515a17e8f7f1a99e83b8b9ad2b1daa4de06bd2
7
- data.tar.gz: 2917282ce852086f06facda93acdd037a5782f217376b709c00ab05a0805bf72c4e7ac67520e2a99ed60a17dbd7339eb74b57e9564fad65d96956a5326724574
6
+ metadata.gz: eb68e5947593be1fce3b2c7131d7a445615b3a9a47c86db9e5b5e31ba966e0c4f7030c20578e140cfe1f55b824e1224a6a2ef3206317db51fa7bd89b60d93e52
7
+ data.tar.gz: '0138f08797108912f2fdcc4b68fbff18e1def69a35a133d94a4cdc409f1a12f695ca8d155df4f3349fa99da0a551b9863a47e61b9984609ef2d815e553969a20'
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 1.2.1 (2023-10-20)
6
+
7
+ - Fix incompatibility when loading the plugin from YAML and using other RuboCop options.
8
+
5
9
  ## 1.2.0 (2023-01-31)
6
10
 
7
11
  - Fix parsing compound syntax hints in code snippets.
data/README.md CHANGED
@@ -12,7 +12,12 @@ Run Rubocop against your Markdown files to make sure that code examples follow s
12
12
  - Preserves specified language (i.e., do not try to analyze "\`\`\`sh")
13
13
  - **Supports autocorrect 📝**
14
14
 
15
- This project was developed to keep [test-prof](https://github.com/test-prof/test-prof) guides consistent with Ruby style guide.
15
+ This project was developed to keep [test-prof](https://github.com/test-prof/test-prof) guides consistent with Ruby style guide back in 2017. Since then, many popular Ruby projects adopted it, including:
16
+
17
+ - [Ruby on Rails](https://github.com/rails/rails)
18
+ - [AnyCable](https://github.com/anycable/anycable)
19
+ - [ViewComponent](https://github.com/ViewComponent/view_component)
20
+ - [Action Policy](https://github.com/palkan/action_policy)
16
21
 
17
22
  ## Installation
18
23
 
@@ -111,7 +116,7 @@ Lint/Void:
111
116
 
112
117
  You can use this tricks
113
118
 
114
- ```md
119
+ ````md
115
120
  # my_post.md
116
121
 
117
122
  ... some markdown ...
@@ -129,7 +134,7 @@ end of snippet
129
134
  <span style="display:none;"># rubocop:enable all</span>
130
135
 
131
136
  ... continuation of article ...
132
- ```
137
+ ````
133
138
 
134
139
  ## How it works?
135
140
 
@@ -42,9 +42,10 @@ RuboCop::Markdown.inject!
42
42
 
43
43
  RuboCop::Runner.prepend(Module.new do
44
44
  # Set config store for Markdown
45
- def initialize(*args)
45
+ def get_processed_source(*args)
46
+ RuboCop::Markdown.config_store = @config_store unless RuboCop::Markdown.config_store
47
+
46
48
  super
47
- RuboCop::Markdown.config_store = @config_store
48
49
  end
49
50
 
50
51
  # Do not cache markdown files, 'cause cache doesn't know about processing.
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module Markdown
5
- VERSION = "1.2.0"
5
+ VERSION = "1.2.1"
6
6
  end
7
7
  end
@@ -9,7 +9,7 @@ module RuboCop
9
9
  PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze
10
10
  CONFIG_DEFAULT = PROJECT_ROOT.join("config", "default.yml").freeze
11
11
 
12
- require_relative "./markdown/preprocess"
13
- require_relative "./markdown/rubocop_ext" if defined?(::RuboCop::ProcessedSource)
12
+ require_relative "markdown/preprocess"
13
+ require_relative "markdown/rubocop_ext" if defined?(::RuboCop::ProcessedSource)
14
14
  end
15
15
  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: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Dementyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-31 00:00:00.000000000 Z
11
+ date: 2023-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -74,28 +74,16 @@ executables: []
74
74
  extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
- - ".gem_release.yml"
78
- - ".github/dependabot.yml"
79
- - ".github/workflows/lint.yml"
80
- - ".github/workflows/test-jruby.yml"
81
- - ".github/workflows/test.yml"
82
- - ".gitignore"
83
- - ".rubocop.yml"
84
- - ".travis.yml"
85
77
  - CHANGELOG.md
86
- - Gemfile
87
78
  - LICENSE.txt
88
79
  - README.md
89
- - Rakefile
90
80
  - config/default.yml
91
- - gemfiles/rubocopmaster.gemfile
92
81
  - lib/rubocop-md.rb
93
82
  - lib/rubocop/markdown.rb
94
83
  - lib/rubocop/markdown/preprocess.rb
95
84
  - lib/rubocop/markdown/rubocop_ext.rb
96
85
  - lib/rubocop/markdown/version.rb
97
- - rubocop-md.gemspec
98
- homepage: https://github.com/palkan/rubocop-md
86
+ homepage: https://github.com/rubocop-hq/rubocop-md
99
87
  licenses:
100
88
  - MIT
101
89
  metadata:
@@ -119,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
107
  - !ruby/object:Gem::Version
120
108
  version: '0'
121
109
  requirements: []
122
- rubygems_version: 3.3.11
110
+ rubygems_version: 3.4.20
123
111
  signing_key:
124
112
  specification_version: 4
125
113
  summary: Run Rubocop against your Markdown files to make sure that code examples follow
data/.gem_release.yml DELETED
@@ -1,3 +0,0 @@
1
- bump:
2
- file: lib/rubocop/markdown/version.rb
3
- skip_ci: true
@@ -1,6 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: 'github-actions'
4
- directory: '/'
5
- schedule:
6
- interval: 'weekly'
@@ -1,41 +0,0 @@
1
- name: Lint
2
-
3
- on:
4
- push:
5
- branches:
6
- - master
7
- pull_request:
8
-
9
- jobs:
10
- rubocop:
11
- runs-on: ubuntu-latest
12
- env:
13
- BUNDLE_JOBS: 4
14
- BUNDLE_RETRY: 3
15
- CI: true
16
- steps:
17
- - uses: actions/checkout@v3
18
- - uses: ruby/setup-ruby@v1
19
- with:
20
- ruby-version: 2.7
21
- bundler-cache: true
22
- - name: Run Rubocop
23
- run: |
24
- bundle exec rubocop
25
- rubocop-md:
26
- runs-on: ubuntu-latest
27
- env:
28
- BUNDLE_JOBS: 4
29
- BUNDLE_RETRY: 3
30
- CI: true
31
- steps:
32
- - uses: actions/checkout@v3
33
- - uses: ruby/setup-ruby@v1
34
- with:
35
- ruby-version: 3.1
36
- bundler-cache: true
37
- - name: Run Rubocop
38
- run: |
39
- bundle exec rubocop -r./lib/rubocop-md.rb README.md CHANGELOG.md
40
- git status
41
- git diff --exit-code
@@ -1,24 +0,0 @@
1
- name: JRuby Test
2
-
3
- on:
4
- push:
5
- branches:
6
- - master
7
- pull_request:
8
-
9
- jobs:
10
- test:
11
- runs-on: ubuntu-latest
12
- env:
13
- BUNDLE_JOBS: 4
14
- BUNDLE_RETRY: 3
15
- CI: true
16
- steps:
17
- - uses: actions/checkout@v3
18
- - uses: ruby/setup-ruby@v1
19
- with:
20
- ruby-version: jruby
21
- bundler-cache: true
22
- - name: Run tests
23
- run: |
24
- bundle exec rake test
@@ -1,38 +0,0 @@
1
- name: Test
2
-
3
- on:
4
- push:
5
- branches:
6
- - master
7
- pull_request:
8
- schedule:
9
- - cron: "10 4 * * */2"
10
-
11
- jobs:
12
- test:
13
- runs-on: ubuntu-latest
14
- env:
15
- BUNDLE_JOBS: 4
16
- BUNDLE_RETRY: 3
17
- CI: true
18
- strategy:
19
- fail-fast: false
20
- matrix:
21
- ruby: ["2.7", "3.0", "3.1", "3.2", ruby-head]
22
- gemfile: [
23
- "Gemfile"
24
- ]
25
- include:
26
- - ruby: "2.6"
27
- gemfile: "Gemfile"
28
- - ruby: "3.1"
29
- gemfile: "gemfiles/rubocopmaster.gemfile"
30
- steps:
31
- - uses: actions/checkout@v3
32
- - uses: ruby/setup-ruby@v1
33
- with:
34
- ruby-version: ${{ matrix.ruby }}
35
- bundler-cache: true
36
- - name: Run tests
37
- run: |
38
- bundle exec rake test
data/.gitignore DELETED
@@ -1,10 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /Gemfile.local
5
- /_yardoc/
6
- /coverage/
7
- /doc/
8
- /pkg/
9
- /spec/reports/
10
- /tmp/
data/.rubocop.yml DELETED
@@ -1,63 +0,0 @@
1
- AllCops:
2
- NewCops: enable
3
- Include:
4
- - 'lib/**/*.rb'
5
- - 'lib/**/*.rake'
6
- - 'test/**/*.rb'
7
- Exclude:
8
- - 'bin/**/*'
9
- - 'vendor/**/*'
10
- - 'tmp/**/*'
11
- - 'Rakefile'
12
- - 'Gemfile'
13
- - '*.gemspec'
14
- DisplayCopNames: true
15
- StyleGuideCopsOnly: false
16
- TargetRubyVersion: 2.5
17
- SuggestExtensions: false
18
-
19
- Style/Documentation:
20
- Exclude:
21
- - 'test/**/*.rb'
22
-
23
- Style/StringLiterals:
24
- EnforcedStyle: double_quotes
25
-
26
- Style/RegexpLiteral:
27
- Enabled: false
28
-
29
- Style/ClassAndModuleChildren:
30
- Exclude:
31
- - 'test/**/*.rb'
32
-
33
- Style/HashEachMethods:
34
- Enabled: true
35
-
36
- Style/HashTransformKeys:
37
- Enabled: true
38
-
39
- Style/HashTransformValues:
40
- Enabled: true
41
-
42
- Layout/EmptyLinesAroundArguments:
43
- Enabled: false
44
-
45
- Layout/SpaceInsideStringInterpolation:
46
- EnforcedStyle: no_space
47
-
48
- Naming/FileName:
49
- Exclude:
50
- - 'lib/rubocop-md.rb'
51
-
52
- Layout/LineLength:
53
- Max: 100
54
- Exclude:
55
- - 'test/**/*.rb'
56
-
57
- Metrics/MethodLength:
58
- Exclude:
59
- - 'test/**/*.rb'
60
-
61
- Metrics/ClassLength:
62
- Exclude:
63
- - 'test/**/*.rb'
data/.travis.yml DELETED
@@ -1,33 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- before_install:
4
- - gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
5
- - gem install bundler -v '< 2'
6
-
7
- notifications:
8
- email: false
9
-
10
- matrix:
11
- fast_finish: true
12
- include:
13
- - rvm: ruby-head
14
- gemfile: gemfiles/rubocopmaster.gemfile
15
- - rvm: jruby-9.2.8.0
16
- gemfile: Gemfile
17
- - rvm: 2.7
18
- gemfile: gemfiles/rubocopmaster.gemfile
19
- - rvm: 2.7
20
- gemfile: Gemfile
21
- - rvm: 2.6
22
- gemfile: Gemfile
23
- - rvm: 2.5
24
- gemfile: Gemfile
25
- - rvm: 2.4.2
26
- gemfile: Gemfile
27
- allow_failures:
28
- - rvm: ruby-head
29
- gemfile: gemfiles/rubocopmaster.gemfile
30
- - rvm: jruby-9.2.8.0
31
- gemfile: Gemfile
32
- - rvm: 2.5.0
33
- gemfile: gemfiles/rubocopmaster.gemfile
data/Gemfile DELETED
@@ -1,12 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
- # Specify your gem's dependencies in rubocop-md.gemspec
6
- gemspec
7
-
8
- local_gemfile = "Gemfile.local"
9
-
10
- if File.exist?(local_gemfile)
11
- eval(File.read(local_gemfile)) # rubocop:disable Security/Eval
12
- end
data/Rakefile DELETED
@@ -1,14 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
3
- require "rubocop/rake_task"
4
-
5
- Rake::TestTask.new(:test) do |t|
6
- t.libs << "test"
7
- t.libs << "lib"
8
- t.warning = false
9
- t.test_files = FileList["test/**/*_test.rb"]
10
- end
11
-
12
- RuboCop::RakeTask.new
13
-
14
- task default: [:rubocop, :test]
@@ -1,5 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "rubocop", github: "bbatsov/rubocop"
4
-
5
- gemspec path: ".."
data/rubocop-md.gemspec DELETED
@@ -1,37 +0,0 @@
1
- lib = File.expand_path("../lib", __FILE__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require "rubocop/markdown/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "rubocop-md"
7
- spec.version = RuboCop::Markdown::VERSION
8
- spec.authors = ["Vladimir Dementyev"]
9
- spec.email = ["dementiev.vm@gmail.com"]
10
-
11
- spec.summary = %q{Run Rubocop against your Markdown files to make sure that code examples follow style guidelines.}
12
- spec.description = %q{Run Rubocop against your Markdown files to make sure that code examples follow style guidelines.}
13
- spec.homepage = "https://github.com/palkan/rubocop-md"
14
- spec.license = "MIT"
15
-
16
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
- f.match(%r{^(test|spec|features)/})
18
- end
19
-
20
- spec.metadata = {
21
- "bug_tracker_uri" => "http://github.com/rubocop-hq/rubocop-md/issues",
22
- "changelog_uri" => "https://github.com/rubocop-hq/rubocop-md/blob/master/CHANGELOG.md",
23
- "documentation_uri" => "https://github.com/rubocop-hq/rubocop-md/blob/master/README.md",
24
- "homepage_uri" => "https://github.com/rubocop-hq/rubocop-md",
25
- "source_code_uri" => "http://github.com/rubocop-hq/rubocop-md"
26
- }
27
-
28
- spec.required_ruby_version = ">= 2.6.0"
29
-
30
- spec.require_paths = ["lib"]
31
-
32
- spec.add_runtime_dependency "rubocop", ">= 1.0"
33
-
34
- spec.add_development_dependency "bundler", ">= 1.15"
35
- spec.add_development_dependency "rake", ">= 13.0"
36
- spec.add_development_dependency "minitest", "~> 5.0"
37
- end