Skip to content

Commit

Permalink
Update README code example for writing Custom linters with correct sy…
Browse files Browse the repository at this point in the history
…ntax. The Custom linter code can be copy/pasted and will be working out of the box now
  • Loading branch information
andapopovici committed Nov 15, 2023
1 parent e450ab9 commit 0114d1f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -539,16 +539,13 @@ module ERBLint
end
self.config_schema = ConfigSchema
def offenses(processed_source)
errors = []
def run(processed_source)
unless processed_source.file_content.include?('this file is fine')
errors << Offense.new(
self,
add_offense(
processed_source.to_source_range(0 ... processed_source.file_content.size),
"This file isn't fine. #{@config.custom_message}"
)
end
errors
end
end
end
Expand Down

0 comments on commit 0114d1f

Please sign in to comment.