Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ AllCops:
- '*.gemspec'
DisplayCopNames: true
StyleGuideCopsOnly: false
TargetRubyVersion: 2.6
SuggestExtensions: false

Style/Documentation:
Expand Down
10 changes: 5 additions & 5 deletions lib/rubocop/markdown/rubocop_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@ def markdown_file?(file)

RuboCop::Runner.prepend(Module.new do
# Set config store for Markdown
def get_processed_source(*args)
def get_processed_source(...)
RuboCop::Markdown.config_store = @config_store unless RuboCop::Markdown.config_store

super
end

# Do not cache markdown files, 'cause cache doesn't know about processing.
# NOTE: we should involve preprocessing in RuboCop::CachedData#deserialize_offenses
def file_offense_cache(file)
def file_offense_cache(file, ...)
return yield if RuboCop::Markdown.markdown_file?(file)

super
end

def file_finished(file, offenses)
def file_finished(file, offenses, ...)
return super unless RuboCop::Markdown.markdown_file?(file)

# Run Preprocess.restore if file has been autocorrected
Expand Down Expand Up @@ -75,14 +75,14 @@ def offenses

# Allow Rubocop to analyze markdown files
RuboCop::TargetFinder.prepend(Module.new do
def ruby_file?(file)
def ruby_file?(file, ...)
super || RuboCop::Markdown.markdown_file?(file)
end
end)

# Extend ProcessedSource#parse with pre-processing
RuboCop::ProcessedSource.prepend(Module.new do
def parse(src, *args)
def parse(src, ...)
# only process Markdown files
src = RuboCop::Markdown::Preprocess.new(path).call(src) if
path && RuboCop::Markdown.markdown_file?(path)
Expand Down