Giter VIP home page Giter VIP logo

grunt-accessibility's People

Contributors

prantlf avatar roman01la avatar xhmikosr avatar yargalot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grunt-accessibility's Issues

Make output less verbose

Example:

Running "bootlint:files" (bootlint) task

>> 52 file(s) lint free.

Passing --verbose should show all the info, but by default, that info is just extra bloat.

I can have a look when I have some time, unless someone else beats me to it.

insert line to report

It would also be great if the report would tell me what Line the error occured on.

Right now it is really hard to find the element sometimes when it only tells me that element "a" is the source of the error

create report when warnings occur

when testing the html and a warning occurs it aborts the grunt task and thus no report is created to see how to deal with the problem. So I can't really solve the problem without --force

Thanks again :)

Hang when using HTML partials

When using the ** glob operator in my files / src array, the task hangs indefinitely when processing the first file in that directory.

Config:

files: [{
        expand: true,
        flatten: false,
        cwd: '<%= project.paths.forms %>',
        src: [ 'modules/**/*.html' ],
        dest: '<%= project.paths.reportData %>/WCAG'
    }]

It works for directories if I leave out the globbing pattern, so I think it is related to that.

v1.2.1 is the last version that didn't hang, but it also only processes the first file matched in the globbing pattern for some reason.

option for outputting warnings only

maybe it is useful to have an option that let users decide what they want to be in their report. In short: I would like only warnings to show up

thanks again :)

Create report without setting force to true?

Is there a way to have the task create a report without setting the force option to true?

I am trying to achieve a grunt build task that will fail if the accessibility task fails due to accessibility notices, warnings, or errors being discovered, but being able to view the report in this case would be very beneficial. It seems that the only way to have the task create a report after notices, warnings, or errors are discovered is to set force to true, right?

PhantomJS process doesn't exit

After processing is done, there are a bunch of PhantomJS processes still running in background, per each file. This can easily drive system out of memory by running task on a large set of files or multiple times on a smaller one.

It seems to me, the problem is within fs.write in bridge.js. According to Node.js API reference, it's unsafe to use fs.write multiple times on the same file without waiting for the callback.

Looking into it, but still not sure.
I'm on Ubuntu 13.10 32-bit

Errors don't fail the grunt task

I'd expect errors to fail the grunt task and halt execution, but even setting force (as documented by AccessSniff) to false doesn't stop the task.

Fatal error: Maximum call stack size exceeded

Steven,

I've just added your plugin to my project and I can't run any test as every time I get an error:

$ grunt accessibility
Running "accessibility:test" (accessibility) task
Running accessibility tests
Page Loaded. Starting Tests
Fatal error: Maximum call stack size exceeded

My configuration:

    accessibility: {
        options : {
            accessibilityLevel: 'WCAG2AA'
        },
        test : {
            files: [{
                expand  : true,
                force: true,
                src     : ['build/no-template.html'],
                dest    : '',
                ext     : '-report.txt'
            }]
        }
    },

Fatal Error: Maximum call stack size exceeded

I'm getting "Fatal Error: Maximum call stack size exceeded" every time when running.

Here's my Gruntfile.js configuration

  module.exports = function(grunt) {

    grunt.initConfig(
      {
        accessibility: {
          options : {
            force: false,
            accessibilityLevel: 'WCAG2AA',
            verbose: true
          },
          test : {
            files: [{
              expand : true,
              cwd : 'source/',
              src : ['index.html'],
              dest : 'reports/',
              ext : '-report.txt'
            }]
          }
        }
      }
    );

    grunt.loadNpmTasks('grunt-accessibility');
    grunt.registerTask('access', 'accessibility');

  }

The terminal output is...

  Running "accessibility:test" (accessibility) task
  Verifying property accessibility.test exists in config...OK
  Files: source/index.html -> reports/index-report.txt
  Options: phantomScript="myprojectpath/node_modules/grunt-accessibility/phantomjs/bridge.js", urls=[], domElement, verbose, force=false, accessibilityLevel="WCAG2AA"
  Running accessibility tests
  Page Loaded. Starting Tests
  Fatal error: Maximum call stack size exceeded

ignored errors still fail the build

I have 'WCAG2A.Principle2.Guideline2_4.2_4_2.H25.1.NoTitleEl' ignored but the build still breaks. This is caused by lines 43-45 in the grunt-accessibility.js.

      if (msgSplit[0] === 'ERROR' && !options.force) {
        grunt.fail.warn(msgSplit[1] + ': ' + msgSplit[2]);
      }

The problem is the ignore logic never gets a chance to run before the build stops. If this block is moved down to line 56 after the following block, it works properly:

      if (ignore) {
        return;
      }

Thanks!

svg xlink:href causes error but should not

Example SVG:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <g>
    <a xlink:href="#anchor">
      <text>Link</text>
    </a>
  </g>
</svg>

Links cause the following error

  • WCAG2A.Principle4.Guideline4_1.4_1_2.H91.A.Placeholder

I would expect this to understand the namespace and find the href behind xlink.

Thank you :)

Partial support

It would be nice to support html partials, so the missing title error isn't always thrown

Test hangs and never completes

After hooking up grunt-accessibility and configuring a task, when I run my "test" task, it just hangs and never completes.

Here is the html it's testing and my full gruntfile

http://codepen.io/anon/pen/KyAfr

Terminal hangs at this:

Running "accessibility:test" (accessibility) task
Running accessibility tests
Page Loaded. Starting Tests

Node, npm and grunt are all up to date. I only run this after the making a build, so it's not being passed partials or anything like that.

output to file overwrites previous file

I have a build directory with multiple .html files in it. I am trying to audit each one and output the results of the audit to a file located in wcag2-reports/. After each run there are not any errors and the dest. directory only has one file in it. That file is always the last one audited from the src. directory. My grunt-accessibility config is below.

module.exports = {
  options : {
    accessibilityLevel: 'WCAG2A',
    force: true,
    outputFormat: 'json',
    verbose: false
  },
  test : {
    files: [{
      expand  : true,
      cwd     : 'build/',
      src     : ['*.html'],
      dest    : 'wcag2-reports/',
      ext     : '-report'
    }]
  }
};

Fatal error: Unexpected end of input

I get this error when using a certain styling: Fatal error: Unexpected end of input

I have narrowed down the SCSS that causes the problem:

.contentbox-head {
  .startnext & {
    display: table;
  }
}
.contentbox-heading {
  .startnext & {
    display: table-cell;
  }
}

and HTML:

<div class="contentbox white">
  <div class="contentbox-head">
    <h2 class="contentbox-heading">Beschriftung</h2>
  </div>
  <div class="contentbox-image">
    <img src="http://imagefoo.dev.webit.de/300x181/bbb/222.png" width="300" height="181" alt="">
  </div>
  <div class="contentbox-content">
    <h3>Tourist Information</h3>
    <p>
      Weit hinten, hinter den Wortbergen, fern der Länder Vokalien und Konsonantien leben die Blindtexte.
    </p>
    <a href="#" class="userlike">Lassen Sie sich beraten</a>
  </div>
</div>

It seems the display: table-cell is causing the accessibility task to exit. The whole setup is here: https://github.com/markusfalk/css-vs-accessibility

Any idea what could cause this error?

Allow forcing the accessibility task to succeed and let Grunt continue

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?

grunt-accessibility doesn't run and just hangs

Hey guys,

I've been trying most of the day to get the a grunt script to run to no avail.

grunt.initConfig({
    accessibility: {
        options : {
            accessibilityLevel: 'WCAG2A',
            domElement: false,
            force: true
        },
        test : {
            files: [{
                expand  : true,
                cwd     : 'templates',
                src     : ['*.html'],
                dest    : 'reports/',
                ext     : '-report.txt'
            }]
        }
    }
});

grunt.loadNpmTasks('grunt-accessibility');

grunt.registerTask('accessibility', ['accessibility']);

The script just hangs, no feedback from grunt, no error. Just hangs...

grunt accessibility

I have installed the plugin using: npm install grunt-accessibility --save-dev

Ae their other dependancies? All my other grunt tasks run fine.

Using pa11y/a11y runs fine, just this plugin doesn't.

It just sit's there doing nothing. Even if I hit ^C it ignores.

What am I missing?

OSX El capitan
node - v7.0.0
npm - v3.10.8
grunt-cli - v1.2.0
grunt - v0.4.5

Help :)

without 'dest:' option report is written to source html file

accessibility: {
      options : {
        accessibilityLevel: 'WCAG2<%= WCAG2 %>',
        accessibilityrc: true,
        domElement: true
      },
      development : {
        files: [{
          expand  : true,
          cwd     : 'build/',
          src     : ['*.html'],
         // dest    : 'WCAG2-reports/',
         // ext     : '-report.txt'
        }]
      }
    },

when no 'dest:' option is given the report will be written into the tested html file deleting all HTML in it

make reports optional

It would be great if I could chose wether to generate a report or not. For those cases where console output is enough.

thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.