From e7df718724341e1ff9ea010ab867afc0376f67b0 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Sat, 18 Sep 2021 19:22:46 -0700 Subject: [PATCH] Strip lines containing "STRIP" from ./striptests --- src/ShellCheck/Analytics.hs | 6 +++--- src/ShellCheck/Formatter/Diff.hs | 3 --- src/ShellCheck/Parser.hs | 10 +++++----- striptests | 1 + 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/ShellCheck/Analytics.hs b/src/ShellCheck/Analytics.hs index 49a6557..de59be1 100644 --- a/src/ShellCheck/Analytics.hs +++ b/src/ShellCheck/Analytics.hs @@ -42,7 +42,7 @@ import Data.List import Data.Maybe import Data.Ord import Data.Semigroup -import Debug.Trace +import Debug.Trace -- STRIP import qualified Data.Map.Strict as Map import Test.QuickCheck.All (forAllProperties) import Test.QuickCheck.Test (quickCheckWithResult, stdArgs, maxSuccess) @@ -1011,8 +1011,8 @@ checkStderrRedirect params redir@(T_Redirecting _ [ checkStderrRedirect _ _ = return () -lt x = trace ("Tracing " ++ show x) x -ltt t = trace ("Tracing " ++ show t) +lt x = trace ("Tracing " ++ show x) x -- STRIP +ltt t = trace ("Tracing " ++ show t) -- STRIP prop_checkSingleQuotedVariables = verify checkSingleQuotedVariables "echo '$foo'" diff --git a/src/ShellCheck/Formatter/Diff.hs b/src/ShellCheck/Formatter/Diff.hs index 9e31780..197b3af 100644 --- a/src/ShellCheck/Formatter/Diff.hs +++ b/src/ShellCheck/Formatter/Diff.hs @@ -38,9 +38,6 @@ import System.FilePath import Test.QuickCheck -import Debug.Trace -ltt x = trace (show x) x - format :: FormatterOptions -> IO Formatter format options = do foundIssues <- newIORef False diff --git a/src/ShellCheck/Parser.hs b/src/ShellCheck/Parser.hs index 30bbb69..e269b4d 100644 --- a/src/ShellCheck/Parser.hs +++ b/src/ShellCheck/Parser.hs @@ -37,7 +37,7 @@ import Data.Functor import Data.List (isPrefixOf, isInfixOf, isSuffixOf, partition, sortBy, intercalate, nub, find) import Data.Maybe import Data.Monoid -import Debug.Trace +import Debug.Trace -- STRIP import GHC.Exts (sortWith) import Prelude hiding (readList) import System.IO @@ -3372,13 +3372,13 @@ parsesCleanly parser string = runIdentity $ do -- For printf debugging: print the value of an expression -- Example: return $ dump $ T_Literal id [c] -dump :: Show a => a -> a -dump x = trace (show x) x +dump :: Show a => a -> a -- STRIP +dump x = trace (show x) x -- STRIP -- Like above, but print a specific expression: -- Example: return $ dumps ("Returning: " ++ [c]) $ T_Literal id [c] -dumps :: Show x => x -> a -> a -dumps t = trace (show t) +dumps :: Show x => x -> a -> a -- STRIP +dumps t = trace (show t) -- STRIP parseWithNotes parser = do item <- parser diff --git a/striptests b/striptests index c68c16a..6e64607 100755 --- a/striptests +++ b/striptests @@ -29,6 +29,7 @@ detestify() { state = 0; } + /STRIP/ { next; } /LANGUAGE TemplateHaskell/ { next; } /^import.*Test\./ { next; }