Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow forcing the accessibility task to succeed and let Grunt continue #44

Open
prantlf opened this issue May 29, 2018 · 0 comments · May be fixed by #45
Open

Allow forcing the accessibility task to succeed and let Grunt continue #44

prantlf opened this issue May 29, 2018 · 0 comments · May be fixed by #45

Comments

@prantlf
Copy link
Contributor

prantlf commented May 29, 2018

The Grunt command-line option --force can suppress the failure in any task. However, sometimes it is needed to suppress the failure in just one task and check the result of the other as usual. Tasks usually support their own boolean option force for this.

For example, one instance f the accessibility task could be forced to generate a full report including problems, which have not been fixed yet, while another one could perform the hard check. For example, like this configuration:

  accessibility: {
    'full-report': {
      options: {
        force: true, // ignores the error and lets Grunt continue
        reportType: 'json',
        reportLocation: 'pending'
      },
      src: ['**/*.html']
    },
    'check-fixed': {
      src: ['**/*.html']
    }
  }

used in this task:

  grunt.registerTask('test', [
    'continue:on', 'accessibility:report-all', 'continue:off',
    'accessibility:check-fixed'
  ]);

If the Grunt task should not fail, it must not call grunt.fail.warn, but grunt.log.warn instead. What do you think about supporting the force option like that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant