grunt-sloccount
A grunt plugin for generating sloccount compatible reports
Last updated 7 years ago by asciidisco .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install grunt-sloccount 
SYNC missed versions from official npm registry.

grunt-sloccount v0.1.0 Build Status

Generate output similar to the SLOCCount tool that can be consumed by the SLOCCount Jenkins Plugin for HTML, CSS & JS

Example output

Creating filelist for src
Categorizing files.
Computing results.

69	js	  src	  /Users/foo/Projects/bar/application/src/application.js
37	css	  src	  /Users/foo/Projects/bar/application/src/application.css
114	html	src	  /Users/foo/Projects/bar/application/src/index.html

Getting Started

This plugin requires Grunt ~0.4.0

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-sloccount --save-dev

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

grunt.loadNpmTasks('grunt-sloccount');

Sloccount task

Run this task with the grunt sloccount command.

Task targets, files and options may be specified according to the grunt Configuring tasks guide.

Options

comments

Type: Bool
Default: true

Generate extra entries for the number of lines in comments

reportPath

Type: String

The pathname where the file should be generated

Usage examples

Fetch source & test directories

sloccount: {
  options: {
    reportPath: 'docs/sloc.sc'
  },
  src: ['src/*.js', 'test/*.js']
}

Contributing

Tests are written in nodeunit & remain in the test folder & can be executed with the grunt test command. Please make sure you adhere to the JS styleguide by running grunt jscs & grunt jshint (and use an editor that can process the .editorconfig file) Indent = 2 spaces.

Release History

  • 2014-07-09   v0.1.1   Fixed problem with comment line count overriding code line count
  • 2014-07-09   v0.1.0   Initial release.

Current Tags

  • 0.1.1                                ...           latest (7 years ago)

2 Versions

  • 0.1.1                                ...           7 years ago
  • 0.1.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (9)
Dependents (2)

Copyright 2014 - 2017 © taobao.org |