Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit 754092f

Browse files
committed
added bin/check_code script, added tslint, csslint, jshint scripts
1 parent 7ef2010 commit 754092f

File tree

3 files changed

+118
-6
lines changed

3 files changed

+118
-6
lines changed

.csslintrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
--format=compact
2+
--quiet
3+
--ignore=adjoining-classes,floats,font-faces,font-sizes,ids,qualified-headings,unique-headings
4+
--exclude-list=foo/bar/static/third-party.css
5+

.jshintrc

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
// JSHint Default Configuration File (as on JSHint website)
3+
// See http://jshint.com/docs/ for more details
4+
5+
"maxerr" : 50, // {int} Maximum error before stopping
6+
7+
// Enforcing
8+
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
9+
"camelcase" : false, // true: Identifiers must be in camelCase
10+
"curly" : true, // true: Require {} for every new block or scope
11+
"eqeqeq" : true, // true: Require triple equals (===) for comparison
12+
"forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty()
13+
"immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
14+
"indent" : 4, // {int} Number of spaces to use for indentation
15+
"latedef" : false, // true: Require variables/functions to be defined before being used
16+
"newcap" : false, // true: Require capitalization of all constructor functions e.g. `new F()`
17+
"noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
18+
"noempty" : true, // true: Prohibit use of empty blocks
19+
"nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment)
20+
"plusplus" : false, // true: Prohibit use of `++` & `--`
21+
"quotmark" : "single", // Quotation mark consistency:
22+
// false : do nothing (default)
23+
// true : ensure whatever is used is consistent
24+
// "single" : require single quotes
25+
// "double" : require double quotes
26+
"undef" : false, // true: Require all non-global variables to be declared (prevents global leaks)
27+
"unused" : false, // true: Require all defined variables be used
28+
"strict" : true, // true: Requires all functions run in ES5 Strict Mode
29+
"trailing" : true, // true: Prohibit trailing whitespaces
30+
"maxparams" : false, // {int} Max number of formal params allowed per function
31+
"maxdepth" : false, // {int} Max depth of nested blocks (within functions)
32+
"maxstatements" : false, // {int} Max number statements per function
33+
"maxcomplexity" : false, // {int} Max cyclomatic complexity per function
34+
"maxlen" : 79, // {int} Max number of characters per line
35+
36+
// Relaxing
37+
"asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
38+
"boss" : false, // true: Tolerate assignments where comparisons would be expected
39+
"debug" : false, // true: Allow debugger statements e.g. browser breakpoints.
40+
"eqnull" : false, // true: Tolerate use of `== null`
41+
"esnext" : true, // true: Allow ES.next (ES6) syntax (ex: `const`)
42+
"moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
43+
// (ex: `for each`, multiple try/catch, function expression…)
44+
"evil" : false, // true: Tolerate use of `eval` and `new Function()`
45+
"expr" : false, // true: Tolerate `ExpressionStatement` as Programs
46+
"funcscope" : false, // true: Tolerate defining variables inside control statements"
47+
"globalstrict" : false, // true: Allow global "use strict" (also enables 'strict')
48+
"iterator" : false, // true: Tolerate using the `__iterator__` property
49+
"lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
50+
"laxbreak" : false, // true: Tolerate possibly unsafe line breakings
51+
"laxcomma" : false, // true: Tolerate comma-first style coding
52+
"loopfunc" : false, // true: Tolerate functions being defined in loops
53+
"multistr" : false, // true: Tolerate multi-line strings
54+
"proto" : false, // true: Tolerate using the `__proto__` property
55+
"scripturl" : false, // true: Tolerate script-targeted URLs
56+
"smarttabs" : false, // true: Tolerate mixed tabs/spaces when used for alignment
57+
"shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
58+
"sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
59+
"supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;`
60+
"validthis" : false, // true: Tolerate using this in a non-constructor function
61+
62+
// Environments
63+
"browser" : true, // Web Browser (window, document, etc)
64+
"couch" : false, // CouchDB
65+
"devel" : true, // Development/debugging (alert, confirm, etc)
66+
"dojo" : false, // Dojo Toolkit
67+
"jquery" : false, // jQuery
68+
"mootools" : false, // MooTools
69+
"node" : false, // Node.js
70+
"nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
71+
"prototypejs" : false, // Prototype and Scriptaculous
72+
"rhino" : false, // Rhino
73+
"worker" : false, // Web Workers
74+
"wsh" : false, // Windows Scripting Host
75+
"yui" : false, // Yahoo User Interface
76+
77+
// Legacy
78+
"nomen" : false, // true: Prohibit dangling `_` in variables
79+
"onevar" : false, // true: Allow only one `var` statement per function
80+
"passfail" : false, // true: Stop on first error
81+
"white" : false, // true: Check against strict whitespace and indentation rules
82+
83+
// Custom Globals
84+
"globals" : {} // additional predefined global variables
85+
}

buildout.cfg

+28-6
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ parts =
1515
sphinx_documentation
1616
sphinx_build_adhocracy
1717
pytest
18+
tslint
19+
jshint
20+
csslint
1821
flake
1922
pylint
23+
check_code
2024
nodejs
21-
# supervisor
2225
auto-checkout = *
2326
develop =
24-
# src/sdidemo
2527
src/adhocracy
2628
src/substanced
2729

@@ -38,7 +40,7 @@ paths = var/blobs
3840
recipe = collective.recipe.template
3941
input = inline:
4042
#!/bin/bash
41-
PATH=${buildout:bin-directory}:$PATH
43+
export PATH=${buildout:bin-directory}:$PATH
4244
output =${buildout:directory}/source_env
4345

4446
[adhocracy]
@@ -53,7 +55,9 @@ eggs = adhocracy
5355

5456
[omelette]
5557
recipe = collective.recipe.omelette
56-
eggs = ${adhocracy:eggs}
58+
eggs =
59+
${flake:eggs}
60+
${adhocracy:eggs}
5761

5862
[sphinx_build_adhocracy]
5963
recipe = collective.recipe.template
@@ -105,6 +109,18 @@ eggs =
105109
flake8_docstrings
106110
pep8-naming
107111

112+
[tslint]
113+
recipe = gp.recipe.node
114+
npms = tslint
115+
116+
[jshint]
117+
recipe = gp.recipe.node
118+
npms = jshint
119+
120+
[csslint]
121+
recipe = gp.recipe.node
122+
npms = csslint
123+
108124
[pylint]
109125
recipe = zc.recipe.egg
110126
eggs =
@@ -123,6 +139,14 @@ scripts =
123139
pylint=pylint_original
124140
pylint_adhoc=pylint
125141

142+
[check_code]
143+
recipe = collective.recipe.template
144+
input = inline:
145+
#!/bin/bash
146+
${buildout:bin-directory}/flake8 --exclude=.svn,CVS,.bzr,.hg,.git,__pycache__,test_* --max-complexity=12 src/adhocracy/adhocracy
147+
output = ${buildout:bin-directory}/check_code
148+
mode = 755
149+
126150
[nodejs]
127151
recipe = gp.recipe.node
128152
version = 0.10.21
@@ -136,5 +160,3 @@ scripts = tsc node
136160
recipe = zc.recipe.egg
137161
dependent-scripts = true
138162
eggs = supervisor
139-
140-

0 commit comments

Comments
 (0)