"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/ShellCheck/Formatter/TTY.hs" between
shellcheck-0.8.0.tar.gz and shellcheck-0.9.0.tar.gz

About: ShellCheck is a static analysis and linting tool for sh/bash scripts (written in Haskell).

TTY.hs  (shellcheck-0.8.0):TTY.hs  (shellcheck-0.9.0)
skipping to change at line 26 skipping to change at line 26
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
-} -}
module ShellCheck.Formatter.TTY (format) where module ShellCheck.Formatter.TTY (format) where
import ShellCheck.Fixer import ShellCheck.Fixer
import ShellCheck.Interface import ShellCheck.Interface
import ShellCheck.Formatter.Format import ShellCheck.Formatter.Format
import Control.DeepSeq
import Control.Monad import Control.Monad
import Data.Array import Data.Array
import Data.Foldable import Data.Foldable
import Data.Ord import Data.Ord
import Data.IORef import Data.IORef
import Data.List import Data.List
import Data.Maybe import Data.Maybe
import GHC.Exts import GHC.Exts
import System.IO import System.IO
import System.Info import System.Info
skipping to change at line 91 skipping to change at line 92
1070, -- Parsing stopped here (generic) 1070, -- Parsing stopped here (generic)
1072, -- Missing/unexpected .. 1072, -- Missing/unexpected ..
1073, -- Couldn't parse this .. 1073, -- Couldn't parse this ..
1088, -- Parsing stopped here (paren) 1088, -- Parsing stopped here (paren)
1089 -- Parsing stopped here (keyword) 1089 -- Parsing stopped here (keyword)
] ]
appendComments errRef comments max = do appendComments errRef comments max = do
previous <- readIORef errRef previous <- readIORef errRef
let current = map (\x -> (rankError x, cCode $ pcComment x, cMessage $ pcCom ment x)) comments let current = map (\x -> (rankError x, cCode $ pcComment x, cMessage $ pcCom ment x)) comments
writeIORef errRef . take max . nubBy equal . sort $ previous ++ current writeIORef errRef $! force . take max . nubBy equal . sort $ previous ++ cur rent
where where
fst3 (x,_,_) = x fst3 (x,_,_) = x
equal x y = fst3 x == fst3 y equal x y = fst3 x == fst3 y
outputWiki :: IORef [(Ranking, Integer, String)] -> IO () outputWiki :: IORef [(Ranking, Integer, String)] -> IO ()
outputWiki errRef = do outputWiki errRef = do
issues <- readIORef errRef issues <- readIORef errRef
unless (null issues) $ do unless (null issues) $ do
putStrLn "For more information:" putStrLn "For more information:"
mapM_ showErr issues mapM_ showErr issues
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)