npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

grunt-flexpmd

v0.1.4

Published

A Grunt task plugin for running FlexPMD to lint/analyze apps built on Adobe Flex/ActionScript/MXML/Flash/AIR/etc. Think of it as "ASLint"/"FlexLint".

Downloads

56

Readme

grunt-flexpmd

A Grunt task plugin for running FlexPMD to lint/analyze apps built on Adobe Flex/ActionScript/MXML/Flash/AIR/etc. Think of it as "ASLint"/"FlexLint".

Getting Started

This plugin requires Grunt ~0.4.2

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-flexpmd --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-flexpmd');

External Dependencies

While this Node/NPM module does not have any external dependencies itself, the underlying FlexPMD tool requires Java.

The "flexpmd" task

Overview

In your project's Gruntfile, add a section named flexpmd to the data object passed into grunt.initConfig().

grunt.initConfig({
  flexpmd: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
})

Options

options.input

Type: String Default value: null

A string value that is used as the single input directory. If a [single] "src" directory is configured, it will override this input option.

options.output

Type: String Default value: null

A string value that is used as the output directory in which to write the results file (named "pmd.xml" by default). If a "dest" file is configured, it will override this output option.

options.ruleset

Type: String Default value: null

A string value that is used as the path to the FlexPMD ruleset. If no ruleset is specified, it will use the default FlexPMD ruleset.

options.priority

Type: Number Default value: 5

An integer value 1-5 (where 1 is the highest priority and 5 is the least) that indicates the minimum violation priority at which to fail the task. For example, if a single priority level 5 violation exists but you have configured options.priority to be 3, the task will not fail.

Note that if you are also generating an XML report file, the report file will contain ALL violations rather than being filtered down based on this priority setting. (If you think this is a silly design choice, please open a new issue to discuss it.)

options.force

Type: Boolean Default value: false

A Boolean value that indicates if the task should succeed even if there are analysis violations. This is probably most useful if you want to generate an XML analysis report for informational purposes but without impacting build status.

Usage Examples

Basic Example

The following example configuration will run the default FlexPMD ruleset over all files in the "src/" directory.

grunt.initConfig({
  flexpmd: {
    example1: {
      src: 'src/'
    }
  }
});

XML Report Example

The following example configuration will run the default FlexPMD ruleset over all files in the "src/" directory and create a report file called "flexlint.xml" in the "reports/" directory. The task will pass even if there are violations because of the force: true option.

grunt.initConfig({
  flexpmd: {
    example2: {
      options: {
        force: true
      },
      'reports/flexlint.xml': ['src/']
    }
  }
});

Custom Ruleset Example

The following example configuration will run a custom FlexPMD ruleset over all files in the "src/" directory and create a report file called "pmd.xml" in the "reports/" directory. The task will fail if there are violations of priority level 3 or higher (1-3).

grunt.initConfig({
  flexpmd: {
    options: {
      input: 'src/',
      output: 'reports/',
      priority: 3
    },
    example3: {
      options: {
        ruleset: 'config/myCustomRuleset.xml'
      }
    }
  }
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

  • 0.1.1: Published to NPM on 2014-03-05.
    • Minor README fix.
  • 0.1.0: Published to NPM on 2014-03-05.
    • Initial release.

Background Information on FlexPMD