From 0114d1fc39583ea4bc7857d6770588956a39a784 Mon Sep 17 00:00:00 2001 From: Anda Popovici Date: Wed, 15 Nov 2023 15:11:18 +0000 Subject: [PATCH] Update README code example for writing Custom linters with correct syntax. The Custom linter code can be copy/pasted and will be working out of the box now --- README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9db49b7..980589c 100644 --- a/README.md +++ b/README.md @@ -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