Example #1
0
        public static ICheckResult CheckNewReleaseNotes(
            this ICakeContext context,
            CheckSettings checkSettings)
        {
            if (!checkSettings.RequireReleaseNotes)
            {
                return(new CheckSkipped());
            }

            if (context.AnyReleaseNotes(checkSettings.ReleaseNotesVNextFile))
            {
                return(new CheckPassed());
            }

            return(CheckFailed.WithReason(
                       $"No new release notes found in {checkSettings.ReleaseNotesVNextFile}"));
        }
Example #2
0
        public static ICheckResult CheckUntrackedFiles(
            this ICakeContext context,
            CheckSettings checkSettings)
        {
            if (!checkSettings.UntrackedFiles)
            {
                return(new CheckSkipped());
            }

            if (!context.GitHasUntrackedFiles(checkSettings.GitRoot))
            {
                return(new CheckPassed());
            }

            return(CheckFailed.WithReason(
                       "Git has untracked files, please commit or ignore files before building"));
        }
Example #3
0
        public static ICheckResult CheckReleaseNotesVNextFileExists(
            this ICakeContext context,
            CheckSettings checkSettings)
        {
            if (!checkSettings.RequireReleaseNotes)
            {
                return(new CheckSkipped());
            }

            if (context.FileExists(checkSettings.ReleaseNotesVNextFile))
            {
                return(new CheckPassed());
            }

            return(CheckFailed.WithReason(
                       $"Unable to find release notes file: {checkSettings.ReleaseNotesVNextFile}"));
        }
Example #4
0
        public static ICheckResult CheckStagedChanges(
            this ICakeContext context,
            CheckSettings checkSettings)
        {
            if (!checkSettings.StagedChanges)
            {
                return(new CheckSkipped());
            }

            if (!context.GitHasStagedChanges(checkSettings.GitRoot))
            {
                return(new CheckPassed());
            }

            return(CheckFailed.WithReason(
                       "Git has staged changed, please commit all files before building"));
        }