Skip to content

Commit

Permalink
Ignore changes to ChangeLog itself by default (only own, no mention i…
Browse files Browse the repository at this point in the history
…n config. Closes #77)
  • Loading branch information
viviag committed Aug 6, 2018
1 parent 1c0d594 commit fb861db
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Changelogged/CheckLog/Check.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ checkLocalChangelogF GitInfo{..} ChangelogConfig{..} = do
eval commit = do
ignoreChangeReasoned <- sequence $
[ commitNotWatched changelogWatchFiles commit
, allFilesIgnored changelogIgnoreFiles commit
, allFilesIgnored changelogIgnoreFiles changelogChangelog commit
, commitIgnored changelogIgnoreCommits commit]
if or ignoreChangeReasoned then return True else do
pull <- fmap (fromJustCustom "Cannot find commit hash in git log entry" . githubRefMatch . lineToText) <$>
Expand All @@ -44,11 +44,11 @@ checkLocalChangelogF GitInfo{..} ChangelogConfig{..} = do
message <- commitMessage PR commit
changelogIsUp gitRemoteUrl pnum PR message changelogChangelog

allFilesIgnored :: Maybe [FilePath] -> Text -> Appl Bool
allFilesIgnored Nothing _ = return False
allFilesIgnored (Just files) commit = do
allFilesIgnored :: Maybe [FilePath] -> FilePath -> Text -> Appl Bool
allFilesIgnored Nothing _ _ = return False
allFilesIgnored (Just files) chLog commit = do
affectedFiles <- fold (inproc "git" ["diff-tree", "--name-only", "--no-commit-id", "-m", commit] empty) Fold.list
return . and $ map (flip elem files . fromText . lineToText) affectedFiles
return . and $ map (flip elem (chLog:files) . fromText . lineToText) affectedFiles

commitNotWatched :: Maybe [FilePath] -> Text -> Appl Bool
commitNotWatched Nothing _ = return False
Expand Down

0 comments on commit fb861db

Please sign in to comment.