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 (#335)
  • Loading branch information
andapopovici authored Nov 16, 2023
1 parent e450ab9 commit 6448416
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 6448416

Please sign in to comment.