- Notifications
You must be signed in to change notification settings - Fork1
zerok/grunt-maxlines
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Enforce a maximum number of lines for your source files. Once a file goes beyondthe specified limit, your build will fail.
This plugin simply wraps thesloc package to determine the number of linesin each file and raises a warning if appropriate. So all kudos belongs to theauthors of that package!
This plugin requires Grunt~0.4.2
To install the plugin run following command in your project's directory:
npm install grunt-maxlines --save-dev
Once you've completed this set, add the plugin to your Gruntfile.js.
grunt.loadNpmTasks('grunt-maxlines');
In your project's Gruntfile's initConfig section add a section namedmaxlines
that configures all the file size limits you want to enforce.
grunt.initConfig({maxlines:{options:{// Task-specific options go here.limit:500},javascript:{// Target-specific file lists and/or options go here.options:{limit:300},files:['src/**/*.js']},scss:{options:{limit:1000},files:['resources/**/*.scss']}}});
Type:Integer
Default value:500
This value sets the maximum number of lines that are allowed.Any files going beyond that limit will trigger a warning.
Type:String
Default value:sloc
Possible values: sloc, loc, loc, cloc, scloc, mcloc, nloc
Defines what metric should be applied to determine if a file has reached thedefined limit or not.
This plugin is licensed under the GPLv3 license due to one of its dependenciesbeing published under this license.