Skip to content

Commit 4fefeef

Browse files
committed
use jsbeautifier to format code as part of grunt build
1 parent 654957a commit 4fefeef

File tree

9 files changed

+78
-7
lines changed

9 files changed

+78
-7
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ trim_trailing_whitespace = true
99
indent_style = space
1010
indent_size = 4
1111

12-
[*.{json}]
12+
[*.json]
1313
indent_size = 2

.jsbeautifyrc

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"js": {
3+
"indent_size": 4,
4+
"indent_char": " ",
5+
"eol": "\n",
6+
"indent_level": 0,
7+
"indent_with_tabs": false,
8+
"preserve_newlines": true,
9+
"max_preserve_newlines": 2,
10+
"space_in_paren": false,
11+
"jslint_happy": true,
12+
"space_after_anon_function": true,
13+
"brace_style": "collapse",
14+
"break_chained_methods": false,
15+
"keep_array_indentation": true,
16+
"unescape_strings": false,
17+
"wrap_line_length": 0,
18+
"end_with_newline": true,
19+
"comma_first": false,
20+
"eval_code": false,
21+
"keep_function_indentation": false,
22+
"space_before_conditional": true,
23+
"good_stuff": true
24+
},
25+
"css": {
26+
"indent_size": 4,
27+
"indent_char": " ",
28+
"indent_with_tabs": false,
29+
"eol": "\n",
30+
"end_with_newline": true,
31+
"selector_separator_newline": false,
32+
"newline_between_rules": true
33+
},
34+
"html": {
35+
"indent_size": 4,
36+
"indent_char": " ",
37+
"indent_with_tabs": false,
38+
"eol": "\n",
39+
"end_with_newline": true,
40+
"preserve_newlines": true,
41+
"max_preserve_newlines": 2,
42+
"indent_inner_html": true,
43+
"brace_style": "collapse",
44+
"indent_scripts": "normal",
45+
"wrap_line_length": 0,
46+
"wrap_attributes": "auto",
47+
"wrap_attributes_indent_size": 4
48+
}
49+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ See [contributing guide](.github/CONTRIBUTING.md)
108108

109109
| Date | Version | Description |
110110
| ----------- | ------- | ----------- |
111-
| 2016-07-29 | v0.0.85 | Maintenance |
111+
| 2016-07-30 | v0.0.86 | Maintenance |
112112
| 2016-06-14 | v0.0.78 | Published via NPM (in addition to bower) |
113113
| 2016-06-14 | v0.0.77 | Maintenance |
114114
| 2016-03-08 | v0.0.65 | Added webNotification.permissionGranted attribute |

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-web-notification",
3-
"version": "0.0.85",
3+
"version": "0.0.86",
44
"description": "AngularJS service for displaying web notifications.",
55
"authors": [
66
"Sagie Gur-Ari <sagiegurari@gmail.com>"

docs/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
| Date | Version | Description |
22
| ----------- | ------- | ----------- |
3-
| 2016-07-29 | v0.0.85 | Maintenance |
3+
| 2016-07-30 | v0.0.86 | Maintenance |
44
| 2016-06-14 | v0.0.78 | Published via NPM (in addition to bower) |
55
| 2016-06-14 | v0.0.77 | Maintenance |
66
| 2016-03-08 | v0.0.65 | Added webNotification.permissionGranted attribute |

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-web-notification",
3-
"version": "0.0.85",
3+
"version": "0.0.86",
44
"description": "AngularJS service for displaying web notifications.",
55
"author": {
66
"name": "Sagie Gur-Ari",
@@ -30,6 +30,7 @@
3030
"clean": "grunt cleanup",
3131
"lint": "grunt lint",
3232
"docs": "grunt docs",
33+
"format": "grunt format",
3334
"build": "grunt build",
3435
"prepush": "npm run build",
3536
"synclibs": "npm install && npm update"
@@ -45,6 +46,7 @@
4546
"grunt-eslint": "latest",
4647
"grunt-force-task": "latest",
4748
"grunt-gitdown": "latest",
49+
"grunt-jsbeautifier": "latest",
4850
"grunt-jscs": "latest",
4951
"grunt-jsdoc-to-markdown": "latest",
5052
"grunt-jslint": "latest",

project/build/common.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,20 @@ module.exports = function (grunt) {
1010
'coverage-ci'
1111
]);
1212

13+
grunt.registerTask('format', 'Format Code.', [
14+
'jsbeautifier:full'
15+
]);
16+
1317
grunt.registerTask('docs', 'Generate docs.', [
1418
'concurrent:docs'
1519
]);
1620

17-
grunt.registerTask('empty', 'Empty Task', []);
18-
1921
grunt.registerTask('lint', 'Linting tasks.', [
2022
'concurrent:lint'
2123
]);
2224

25+
grunt.registerTask('empty', 'Empty Task', []);
26+
2327
return {
2428
tasks: {
2529
concurrent: {

project/build/jsbeautifier.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use strict';
2+
3+
module.exports.tasks = {
4+
jsbeautifier: {
5+
full: {
6+
options: {
7+
config: '.jsbeautifyrc'
8+
},
9+
src: [
10+
require('../../bower.json').main,
11+
'project/build/**/*.js'
12+
]
13+
}
14+
}
15+
};

project/build/top-level.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module.exports = function (grunt) {
1717
]);
1818

1919
grunt.registerTask('build', 'Run all build steps.', [
20+
'format',
2021
'docs',
2122
'lint',
2223
'coverage'

0 commit comments

Comments
 (0)