From 6fb1ce5627216c93712f56d03d1bda4a7284290f Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Mon, 8 Jul 2024 16:12:53 +0200 Subject: [PATCH] Add a reason directive to aid in documenting annotations --- src/ShellCheck/Parser.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ShellCheck/Parser.hs b/src/ShellCheck/Parser.hs index 9cc5e02..a6ca4f1 100644 --- a/src/ShellCheck/Parser.hs +++ b/src/ShellCheck/Parser.hs @@ -1083,6 +1083,10 @@ readAnnotationWithoutPrefix sandboxed = do parseNoteAt pos ErrorC 1145 "Unknown external-sources value. Expected true/false." return [] + -- noop to allow a reason to be given for the annotation + "reason" -> do + return [] + _ -> do parseNoteAt keyPos WarningC 1107 "This directive is unknown. It will be ignored." anyChar `reluctantlyTill` whitespace