Skip to content

Commit

Permalink
Move ignore_commits to config for each changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
viviag committed Aug 6, 2018
1 parent daaf833 commit 7dfb6f7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
7 changes: 4 additions & 3 deletions .changelogged.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ changelogs:
# watch all files except for the changelog itself
ignore_files:
- ChangeLog.md

# which individual changes to ignore
#
# ignore_commits: []

# which files to modify when performing a regular version bump
version_files:
Expand Down Expand Up @@ -54,6 +58,3 @@ changelogs:
#
# branch: master

# which individual changes to ignore
#
# ignore_commits: []
25 changes: 12 additions & 13 deletions src/Changelogged/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import Changelogged.Pure

data Config = Config
{ configChangelogs :: [ChangelogConfig]
, configIgnoreCommits :: Maybe [Text]
, configBranch :: Maybe Text
} deriving (Eq, Show, Generic)

Expand All @@ -31,11 +30,12 @@ data LevelHeaders = LevelHeaders
} deriving (Eq, Show, Generic)

data ChangelogConfig = ChangelogConfig
{ changelogChangelog :: Turtle.FilePath
, changelogLevelHeaders :: LevelHeaders
, changelogWatchFiles :: Maybe [Turtle.FilePath]
, changelogIgnoreFiles :: Maybe [Turtle.FilePath]
, changelogVersionFiles :: Maybe [VersionFile]
{ changelogChangelog :: Turtle.FilePath
, changelogLevelHeaders :: LevelHeaders
, changelogWatchFiles :: Maybe [Turtle.FilePath]
, changelogIgnoreFiles :: Maybe [Turtle.FilePath]
, changelogIgnoreCommits :: Maybe [Text]
, changelogVersionFiles :: Maybe [VersionFile]
} deriving (Eq, Show, Generic)

data VersionPattern = VersionPattern
Expand All @@ -60,13 +60,13 @@ defaultLevelHeaders = LevelHeaders
defaultConfig :: Config
defaultConfig = Config
{ configChangelogs = pure ChangelogConfig
{ changelogChangelog = "ChangeLog.md"
, changelogLevelHeaders = defaultLevelHeaders
, changelogWatchFiles = Nothing -- watch everything
, changelogIgnoreFiles = Nothing -- ignore nothing
, changelogVersionFiles = Just [VersionFile "package.yaml" (VersionPattern "version" ":")]
{ changelogChangelog = "ChangeLog.md"
, changelogLevelHeaders = defaultLevelHeaders
, changelogWatchFiles = Nothing -- watch everything
, changelogIgnoreFiles = Nothing -- ignore nothing
, changelogIgnoreCommits = Nothing
, changelogVersionFiles = Just [VersionFile "package.yaml" (VersionPattern "version" ":")]
}
, configIgnoreCommits = Nothing
, configBranch = Nothing
}

Expand All @@ -80,7 +80,6 @@ loadConfig path = do
ppConfig :: Config -> Text
ppConfig Config{..} = mconcat
[ "Main branch (with version tags)" ?: configBranch
, "Ignored commits" ?: (Text.pack . show . length <$> configIgnoreCommits)
, "Changelogs" !: formatItems Turtle.fp (map changelogChangelog configChangelogs)
]
where
Expand Down

0 comments on commit 7dfb6f7

Please sign in to comment.