jlint 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +33 -0
- data/Rakefile +1 -0
- data/bin/checkstyle.jar +0 -0
- data/doc/google_checks.xml +168 -0
- data/doc/sun_checks.xml +179 -0
- data/jlint.gemspec +23 -0
- data/lib/jlint.rb +30 -0
- data/lib/jlint/version.rb +3 -0
- metadata +85 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8b5d44e5a295d7ffe71e14f79daf5186ff8bea7d
|
4
|
+
data.tar.gz: ff8476f35b72d659fc04ec092fdcafbae5f1592a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 49969fd02dcbfb5e2162b53168a2a892dd3f356e1e2990f9b42ae1e038ddcd9e8a01d6efdf778cd3f71992e158fc0999fa712334eced3cb72b280a9d5cd66f83
|
7
|
+
data.tar.gz: 19c1000afdea425a47f862787678469ff4c224805e1c6dd47e15f716d00f617b3cff2653a4b05e7e286129698e8d1453b08031f5b9ae7dde24c0c2698244224f
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
jlint-0.0.1.gem
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 soffolk
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# Jlint
|
2
|
+
|
3
|
+
Ruby Warp for CheckStyle: https://github.com/checkstyle/checkstyle
|
4
|
+
|
5
|
+
Provide more friendly interface for Rubist
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
gem 'jlint'
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install jlint
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
Jlint.lint(content, config) # [message, line]
|
25
|
+
```
|
26
|
+
|
27
|
+
## Contributing
|
28
|
+
|
29
|
+
1. Fork it ( http://github.com/<my-github-username>/jlint/fork )
|
30
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
31
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
32
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
33
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/checkstyle.jar
ADDED
Binary file
|
@@ -0,0 +1,168 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<!DOCTYPE module PUBLIC
|
3
|
+
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
|
4
|
+
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
5
|
+
|
6
|
+
<!--
|
7
|
+
|
8
|
+
Checkstyle configurartion that checks the Google coding conventions from:
|
9
|
+
|
10
|
+
- Google Java Style
|
11
|
+
https://google-styleguide.googlecode.com/svn-history/r130/trunk/javaguide.html
|
12
|
+
|
13
|
+
Checkstyle is very configurable. Be sure to read the documentation at
|
14
|
+
http://checkstyle.sf.net (or in your downloaded distribution).
|
15
|
+
|
16
|
+
Most Checks are configurable, be sure to consult the documentation.
|
17
|
+
|
18
|
+
To completely disable a check, just comment it out or delete it from the file.
|
19
|
+
|
20
|
+
Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
|
21
|
+
|
22
|
+
-->
|
23
|
+
|
24
|
+
<module name = "Checker">
|
25
|
+
<property name="charset" value="UTF-8"/>
|
26
|
+
|
27
|
+
<property name="severity" value="warning"/>
|
28
|
+
|
29
|
+
<!-- Checks for whitespace -->
|
30
|
+
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
|
31
|
+
<module name="FileTabCharacter">
|
32
|
+
<property name="eachLine" value="true"/>
|
33
|
+
</module>
|
34
|
+
|
35
|
+
<module name="TreeWalker">
|
36
|
+
<module name="OuterTypeFilename"/>
|
37
|
+
<module name="IllegalTokenText">
|
38
|
+
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
|
39
|
+
<property name="format" value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
|
40
|
+
<property name="message" value="Avoid using corresponding octal or Unicode escape."/>
|
41
|
+
</module>
|
42
|
+
<module name="AvoidEscapedUnicodeCharacters">
|
43
|
+
<property name="allowEscapesForControlCharacters" value="true"/>
|
44
|
+
<property name="allowByTailComment" value="true"/>
|
45
|
+
<property name="allowNonPrintableEscapes" value="true"/>
|
46
|
+
</module>
|
47
|
+
<module name="LineLength">
|
48
|
+
<property name="max" value="100"/>
|
49
|
+
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
|
50
|
+
</module>
|
51
|
+
<module name="AvoidStarImport"/>
|
52
|
+
<module name="OneTopLevelClass"/>
|
53
|
+
<module name="NoLineWrap"/>
|
54
|
+
<module name="EmptyBlock">
|
55
|
+
<property name="option" value="TEXT"/>
|
56
|
+
<property name="tokens" value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
|
57
|
+
</module>
|
58
|
+
<module name="NeedBraces"/>
|
59
|
+
<module name="LeftCurly">
|
60
|
+
<property name="maxLineLength" value="100"/>
|
61
|
+
</module>
|
62
|
+
<module name="RightCurly"/>
|
63
|
+
<module name="RightCurly">
|
64
|
+
<property name="option" value="alone"/>
|
65
|
+
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
|
66
|
+
</module>
|
67
|
+
<module name="WhitespaceAround">
|
68
|
+
<property name="allowEmptyConstructors" value="true"/>
|
69
|
+
<property name="allowEmptyMethods" value="true"/>
|
70
|
+
<property name="allowEmptyTypes" value="true"/>
|
71
|
+
<property name="allowEmptyLoops" value="true"/>
|
72
|
+
<message key="ws.notFollowed"
|
73
|
+
value="WhitespaceAround: ''{0}'' is not followed by whitespace."/>
|
74
|
+
<message key="ws.notPreceded"
|
75
|
+
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
|
76
|
+
</module>
|
77
|
+
<module name="OneStatementPerLine"/>
|
78
|
+
<module name="MultipleVariableDeclarations"/>
|
79
|
+
<module name="ArrayTypeStyle"/>
|
80
|
+
<module name="MissingSwitchDefault"/>
|
81
|
+
<module name="FallThrough"/>
|
82
|
+
<module name="UpperEll"/>
|
83
|
+
<module name="ModifierOrder"/>
|
84
|
+
<module name="EmptyLineSeparator">
|
85
|
+
<property name="allowNoEmptyLineBetweenFields" value="true"/>
|
86
|
+
</module>
|
87
|
+
<module name="SeparatorWrap">
|
88
|
+
<property name="tokens" value="DOT"/>
|
89
|
+
<property name="option" value="nl"/>
|
90
|
+
</module>
|
91
|
+
<module name="SeparatorWrap">
|
92
|
+
<property name="tokens" value="COMMA"/>
|
93
|
+
<property name="option" value="EOL"/>
|
94
|
+
</module>
|
95
|
+
<module name="PackageName">
|
96
|
+
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
|
97
|
+
<message key="name.invalidPattern"
|
98
|
+
value="Package name ''{0}'' must match pattern ''{1}''."/>
|
99
|
+
</module>
|
100
|
+
<module name="TypeName">
|
101
|
+
<message key="name.invalidPattern"
|
102
|
+
value="Type name ''{0}'' must match pattern ''{1}''."/>
|
103
|
+
</module>
|
104
|
+
<module name="MemberName">
|
105
|
+
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
|
106
|
+
<message key="name.invalidPattern"
|
107
|
+
value="Member name ''{0}'' must match pattern ''{1}''."/>
|
108
|
+
</module>
|
109
|
+
<module name="ParameterName">
|
110
|
+
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
|
111
|
+
<message key="name.invalidPattern"
|
112
|
+
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
|
113
|
+
</module>
|
114
|
+
<module name="LocalVariableName">
|
115
|
+
<property name="tokens" value="VARIABLE_DEF"/>
|
116
|
+
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
|
117
|
+
<property name="allowOneCharVarInForLoop" value="true"/>
|
118
|
+
<message key="name.invalidPattern"
|
119
|
+
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
|
120
|
+
</module>
|
121
|
+
<module name="ClassTypeParameterName">
|
122
|
+
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
123
|
+
<message key="name.invalidPattern"
|
124
|
+
value="Class type name ''{0}'' must match pattern ''{1}''."/>
|
125
|
+
</module>
|
126
|
+
<module name="MethodTypeParameterName">
|
127
|
+
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
128
|
+
<message key="name.invalidPattern"
|
129
|
+
value="Method type name ''{0}'' must match pattern ''{1}''."/>
|
130
|
+
</module>
|
131
|
+
<module name="NoFinalizer"/>
|
132
|
+
<module name="GenericWhitespace">
|
133
|
+
<message key="ws.followed"
|
134
|
+
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
|
135
|
+
<message key="ws.preceded"
|
136
|
+
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
|
137
|
+
<message key="ws.illegalFollow"
|
138
|
+
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
|
139
|
+
<message key="ws.notPreceded"
|
140
|
+
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
|
141
|
+
</module>
|
142
|
+
<module name="Indentation">
|
143
|
+
<property name="basicOffset" value="2"/>
|
144
|
+
<property name="braceAdjustment" value="0"/>
|
145
|
+
<property name="caseIndent" value="2"/>
|
146
|
+
<property name="throwsIndent" value="4"/>
|
147
|
+
<property name="lineWrappingIndentation" value="4"/>
|
148
|
+
<property name="arrayInitIndent" value="2"/>
|
149
|
+
</module>
|
150
|
+
<module name="AbbreviationAsWordInName">
|
151
|
+
<property name="ignoreFinal" value="false"/>
|
152
|
+
<property name="allowedAbbreviationLength" value="1"/>
|
153
|
+
</module>
|
154
|
+
<module name="OverloadMethodsDeclarationOrder"/>
|
155
|
+
<module name="VariableDeclarationUsageDistance"/>
|
156
|
+
<module name="CustomImportOrder">
|
157
|
+
<property name="thirdPartyPackageRegExp" value=".*"/>
|
158
|
+
<property name="specialImportsRegExp" value="com.google"/>
|
159
|
+
<property name="sortImportsInGroupAlphabetically" value="true"/>
|
160
|
+
<property name="customImportOrderRules" value="STATIC###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE###STANDARD_JAVA_PACKAGE"/>
|
161
|
+
</module>
|
162
|
+
<module name="MethodParamPad"/>
|
163
|
+
<module name="OperatorWrap">
|
164
|
+
<property name="option" value="NL"/>
|
165
|
+
<property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/>
|
166
|
+
</module>
|
167
|
+
</module>
|
168
|
+
</module>
|
data/doc/sun_checks.xml
ADDED
@@ -0,0 +1,179 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<!DOCTYPE module PUBLIC
|
3
|
+
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
|
4
|
+
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
5
|
+
|
6
|
+
<!--
|
7
|
+
|
8
|
+
Checkstyle configuration that checks the sun coding conventions from:
|
9
|
+
|
10
|
+
- the Java Language Specification at
|
11
|
+
http://java.sun.com/docs/books/jls/second_edition/html/index.html
|
12
|
+
|
13
|
+
- the Sun Code Conventions at http://java.sun.com/docs/codeconv/
|
14
|
+
|
15
|
+
- the Javadoc guidelines at
|
16
|
+
http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
|
17
|
+
|
18
|
+
- the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
|
19
|
+
|
20
|
+
- some best practices
|
21
|
+
|
22
|
+
Checkstyle is very configurable. Be sure to read the documentation at
|
23
|
+
http://checkstyle.sf.net (or in your downloaded distribution).
|
24
|
+
|
25
|
+
Most Checks are configurable, be sure to consult the documentation.
|
26
|
+
|
27
|
+
To completely disable a check, just comment it out or delete it from the file.
|
28
|
+
|
29
|
+
Finally, it is worth reading the documentation.
|
30
|
+
|
31
|
+
-->
|
32
|
+
|
33
|
+
<module name="Checker">
|
34
|
+
<!--
|
35
|
+
If you set the basedir property below, then all reported file
|
36
|
+
names will be relative to the specified directory. See
|
37
|
+
http://checkstyle.sourceforge.net/5.x/config.html#Checker
|
38
|
+
|
39
|
+
<property name="basedir" value="${basedir}"/>
|
40
|
+
-->
|
41
|
+
|
42
|
+
<!-- Checks that a package-info.java file exists for each package. -->
|
43
|
+
<!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage -->
|
44
|
+
<module name="JavadocPackage"/>
|
45
|
+
|
46
|
+
<!-- Checks whether files end with a new line. -->
|
47
|
+
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
|
48
|
+
<module name="NewlineAtEndOfFile"/>
|
49
|
+
|
50
|
+
<!-- Checks that property files contain the same keys. -->
|
51
|
+
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
|
52
|
+
<module name="Translation"/>
|
53
|
+
|
54
|
+
<!-- Checks for Size Violations. -->
|
55
|
+
<!-- See http://checkstyle.sf.net/config_sizes.html -->
|
56
|
+
<module name="FileLength"/>
|
57
|
+
|
58
|
+
<!-- Checks for whitespace -->
|
59
|
+
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
|
60
|
+
<module name="FileTabCharacter"/>
|
61
|
+
|
62
|
+
<!-- Miscellaneous other checks. -->
|
63
|
+
<!-- See http://checkstyle.sf.net/config_misc.html -->
|
64
|
+
<module name="RegexpSingleline">
|
65
|
+
<property name="format" value="\s+$"/>
|
66
|
+
<property name="minimum" value="0"/>
|
67
|
+
<property name="maximum" value="0"/>
|
68
|
+
<property name="message" value="Line has trailing spaces."/>
|
69
|
+
</module>
|
70
|
+
|
71
|
+
<!-- Checks for Headers -->
|
72
|
+
<!-- See http://checkstyle.sf.net/config_header.html -->
|
73
|
+
<!-- <module name="Header"> -->
|
74
|
+
<!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
|
75
|
+
<!-- <property name="fileExtensions" value="java"/> -->
|
76
|
+
<!-- </module> -->
|
77
|
+
|
78
|
+
<module name="TreeWalker">
|
79
|
+
|
80
|
+
<!-- Checks for Javadoc comments. -->
|
81
|
+
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
|
82
|
+
<module name="JavadocMethod"/>
|
83
|
+
<module name="JavadocType"/>
|
84
|
+
<module name="JavadocVariable"/>
|
85
|
+
<module name="JavadocStyle"/>
|
86
|
+
|
87
|
+
|
88
|
+
<!-- Checks for Naming Conventions. -->
|
89
|
+
<!-- See http://checkstyle.sf.net/config_naming.html -->
|
90
|
+
<module name="ConstantName"/>
|
91
|
+
<module name="LocalFinalVariableName"/>
|
92
|
+
<module name="LocalVariableName"/>
|
93
|
+
<module name="MemberName"/>
|
94
|
+
<module name="MethodName"/>
|
95
|
+
<module name="PackageName"/>
|
96
|
+
<module name="ParameterName"/>
|
97
|
+
<module name="StaticVariableName"/>
|
98
|
+
<module name="TypeName"/>
|
99
|
+
|
100
|
+
|
101
|
+
<!-- Checks for imports -->
|
102
|
+
<!-- See http://checkstyle.sf.net/config_import.html -->
|
103
|
+
<module name="AvoidStarImport"/>
|
104
|
+
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
|
105
|
+
<module name="RedundantImport"/>
|
106
|
+
<module name="UnusedImports"/>
|
107
|
+
|
108
|
+
|
109
|
+
<!-- Checks for Size Violations. -->
|
110
|
+
<!-- See http://checkstyle.sf.net/config_sizes.html -->
|
111
|
+
<module name="LineLength">
|
112
|
+
<property name="max" value="100"/>
|
113
|
+
</module>
|
114
|
+
<module name="MethodLength"/>
|
115
|
+
<module name="ParameterNumber"/>
|
116
|
+
|
117
|
+
|
118
|
+
<!-- Checks for whitespace -->
|
119
|
+
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
|
120
|
+
<module name="EmptyForIteratorPad"/>
|
121
|
+
<module name="GenericWhitespace"/>
|
122
|
+
<module name="MethodParamPad"/>
|
123
|
+
<module name="NoWhitespaceAfter"/>
|
124
|
+
<module name="NoWhitespaceBefore"/>
|
125
|
+
<module name="OperatorWrap"/>
|
126
|
+
<module name="ParenPad"/>
|
127
|
+
<module name="TypecastParenPad"/>
|
128
|
+
<module name="WhitespaceAfter"/>
|
129
|
+
<module name="WhitespaceAround"/>
|
130
|
+
|
131
|
+
|
132
|
+
<!-- Modifier Checks -->
|
133
|
+
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
|
134
|
+
<module name="ModifierOrder"/>
|
135
|
+
<module name="RedundantModifier"/>
|
136
|
+
|
137
|
+
|
138
|
+
<!-- Checks for blocks. You know, those {}'s -->
|
139
|
+
<!-- See http://checkstyle.sf.net/config_blocks.html -->
|
140
|
+
<module name="AvoidNestedBlocks"/>
|
141
|
+
<module name="EmptyBlock"/>
|
142
|
+
<module name="LeftCurly"/>
|
143
|
+
<module name="NeedBraces"/>
|
144
|
+
<module name="RightCurly"/>
|
145
|
+
|
146
|
+
|
147
|
+
<!-- Checks for common coding problems -->
|
148
|
+
<!-- See http://checkstyle.sf.net/config_coding.html -->
|
149
|
+
<module name="AvoidInlineConditionals"/>
|
150
|
+
<module name="EmptyStatement"/>
|
151
|
+
<module name="EqualsHashCode"/>
|
152
|
+
<module name="HiddenField"/>
|
153
|
+
<module name="IllegalInstantiation"/>
|
154
|
+
<module name="InnerAssignment"/>
|
155
|
+
<module name="MagicNumber"/>
|
156
|
+
<module name="MissingSwitchDefault"/>
|
157
|
+
<module name="RedundantThrows"/>
|
158
|
+
<module name="SimplifyBooleanExpression"/>
|
159
|
+
<module name="SimplifyBooleanReturn"/>
|
160
|
+
|
161
|
+
<!-- Checks for class design -->
|
162
|
+
<!-- See http://checkstyle.sf.net/config_design.html -->
|
163
|
+
<module name="DesignForExtension"/>
|
164
|
+
<module name="FinalClass"/>
|
165
|
+
<module name="HideUtilityClassConstructor"/>
|
166
|
+
<module name="InterfaceIsType"/>
|
167
|
+
<module name="VisibilityModifier"/>
|
168
|
+
|
169
|
+
|
170
|
+
<!-- Miscellaneous other checks. -->
|
171
|
+
<!-- See http://checkstyle.sf.net/config_misc.html -->
|
172
|
+
<module name="ArrayTypeStyle"/>
|
173
|
+
<module name="FinalParameters"/>
|
174
|
+
<module name="TodoComment"/>
|
175
|
+
<module name="UpperEll"/>
|
176
|
+
|
177
|
+
</module>
|
178
|
+
|
179
|
+
</module>
|
data/jlint.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'jlint/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "jlint"
|
8
|
+
spec.version = Jlint::VERSION
|
9
|
+
spec.authors = ["soffolk"]
|
10
|
+
spec.email = ["zlx.star@gmail.com"]
|
11
|
+
spec.summary = %q{Ruby Warp for CheckStyle: https://github.com/checkstyle/checkstyle}
|
12
|
+
spec.description = %q{Ruby Warp for CheckStyle: https://github.com/checkstyle/checkstyle}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.5"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
end
|
data/lib/jlint.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
class Jlint
|
2
|
+
def self.lint file_path, config
|
3
|
+
new.lint file_path, config
|
4
|
+
end
|
5
|
+
|
6
|
+
def initialize
|
7
|
+
end
|
8
|
+
|
9
|
+
def lint file_path, config
|
10
|
+
parse `java -jar #{checkstyle_command} -c #{checkstyle_config} #{file_path}`
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
def checkstyle_command
|
15
|
+
File.join(File.dirname(__FILE__), '..', 'bin', 'checkstyle.jar')
|
16
|
+
end
|
17
|
+
|
18
|
+
def checkstyle_config
|
19
|
+
File.join(File.dirname(__FILE__), '..', 'doc', 'sun_checks.xml')
|
20
|
+
end
|
21
|
+
|
22
|
+
def parse results
|
23
|
+
array = results.split("\n")
|
24
|
+
array.reject! { |s| s == 'Starting audit...' || s == 'Audit done.' }
|
25
|
+
array.map! do |msg|
|
26
|
+
msgs = msg.split(":")
|
27
|
+
[msgs.last.strip, msgs[1]]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
metadata
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jlint
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- soffolk
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-10-20 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.5'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.5'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: 'Ruby Warp for CheckStyle: https://github.com/checkstyle/checkstyle'
|
42
|
+
email:
|
43
|
+
- zlx.star@gmail.com
|
44
|
+
executables:
|
45
|
+
- checkstyle.jar
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- .gitignore
|
50
|
+
- Gemfile
|
51
|
+
- LICENSE.txt
|
52
|
+
- README.md
|
53
|
+
- Rakefile
|
54
|
+
- bin/checkstyle.jar
|
55
|
+
- doc/google_checks.xml
|
56
|
+
- doc/sun_checks.xml
|
57
|
+
- jlint.gemspec
|
58
|
+
- lib/jlint.rb
|
59
|
+
- lib/jlint/version.rb
|
60
|
+
homepage: ''
|
61
|
+
licenses:
|
62
|
+
- MIT
|
63
|
+
metadata: {}
|
64
|
+
post_install_message:
|
65
|
+
rdoc_options: []
|
66
|
+
require_paths:
|
67
|
+
- lib
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - '>='
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0'
|
73
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
requirements: []
|
79
|
+
rubyforge_project:
|
80
|
+
rubygems_version: 2.0.3
|
81
|
+
signing_key:
|
82
|
+
specification_version: 4
|
83
|
+
summary: 'Ruby Warp for CheckStyle: https://github.com/checkstyle/checkstyle'
|
84
|
+
test_files: []
|
85
|
+
has_rdoc:
|