permpress 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/.rspec +2 -0
- data/.rubocop.yml +18 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +56 -0
- data/Rakefile +6 -0
- data/bin/permpress +5 -0
- data/lib/permpress.rb +2 -0
- data/lib/permpress/checkstyle.rb +26 -0
- data/lib/permpress/checkstyle/checkstyle_logger-all.jar +0 -0
- data/lib/permpress/checkstyle/sun_checks.xml +177 -0
- data/lib/permpress/cli.rb +43 -0
- data/lib/permpress/coffeelint.rb +27 -0
- data/lib/permpress/coffeelint/lintci.coffee +12 -0
- data/lib/permpress/command.rb +42 -0
- data/lib/permpress/csslint.rb +63 -0
- data/lib/permpress/golint.rb +12 -0
- data/lib/permpress/govet.rb +7 -0
- data/lib/permpress/jshint.rb +23 -0
- data/lib/permpress/jshint/formatter.js +23 -0
- data/lib/permpress/jslint.rb +7 -0
- data/lib/permpress/jsonlint.rb +19 -0
- data/lib/permpress/rubocop.rb +28 -0
- data/lib/permpress/rubocop/formatter.rb +22 -0
- data/lib/permpress/scsslint.rb +24 -0
- data/lib/permpress/scsslint/scsslint +37 -0
- data/lib/permpress/version.rb +4 -0
- data/permpress.gemspec +27 -0
- data/spec/fixtures/Good.java +6 -0
- data/spec/fixtures/bad.coffee +1 -0
- data/spec/fixtures/bad.css +4 -0
- data/spec/fixtures/bad.go +7 -0
- data/spec/fixtures/bad.java +3 -0
- data/spec/fixtures/bad.js +3 -0
- data/spec/fixtures/bad.json +4 -0
- data/spec/fixtures/bad.rb +4 -0
- data/spec/fixtures/bad.scss +3 -0
- data/spec/fixtures/good.coffee +1 -0
- data/spec/fixtures/good.css +3 -0
- data/spec/fixtures/good.go +7 -0
- data/spec/fixtures/good.js +5 -0
- data/spec/fixtures/good.json +4 -0
- data/spec/fixtures/good.rb +5 -0
- data/spec/fixtures/good.scss +3 -0
- data/spec/fixtures/lint.txt +1 -0
- data/spec/permpress/checkstyle_spec.rb +66 -0
- data/spec/permpress/coffeelint_spec.rb +64 -0
- data/spec/permpress/command_spec.rb +37 -0
- data/spec/permpress/csslint_spec.rb +65 -0
- data/spec/permpress/golint_spec.rb +43 -0
- data/spec/permpress/jshint_spec.rb +65 -0
- data/spec/permpress/jsonlint_spec.rb +45 -0
- data/spec/permpress/rubocop_spec.rb +67 -0
- data/spec/permpress/scsslint_spec.rb +62 -0
- data/spec/permpress_spec.rb +7 -0
- data/spec/spec_helper.rb +4 -0
- data/spec/support/exit_matcher.rb +15 -0
- data/spec/support/observed_output_context.rb +10 -0
- metadata +204 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ebc54eef5e25e82c2c095ab079068ade3955b341
|
4
|
+
data.tar.gz: d7d65ec6c46c6f4094ef9825f900a0a413d97fc6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3cde514d07e05d2495bbb8604be13865e671280eb795e2a19bf813083a92807019acf4ffbd35a242c265be8ac5c238a1dfb87b3a96063d0bd8768dc699b2b0fc
|
7
|
+
data.tar.gz: f80a75230e88a3a9ded04469ff87dbae95fda9a2c4db719dc5c6f35021fb13e94ef895171e93cf350091a65e6688702e58f17252a901e3ed0217ef50e54719f3
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- 'spec/fixtures/*'
|
4
|
+
|
5
|
+
Style/AccessModifierIndentation:
|
6
|
+
EnforcedStyle: outdent
|
7
|
+
|
8
|
+
Style/LineLength:
|
9
|
+
Max: 120
|
10
|
+
|
11
|
+
Style/RegexpLiteral:
|
12
|
+
MaxSlashes: 0
|
13
|
+
|
14
|
+
Style/SpaceBeforeBlockBraces:
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
Style/SpaceInsideBlockBraces:
|
18
|
+
Enabled: false
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Allen Madsen
|
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,56 @@
|
|
1
|
+
# Permpress
|
2
|
+
|
3
|
+
A CLI to wrap the inconsistencies of various linters.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'permpress'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install permpress
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
The following request that you have all dependencies installed
|
24
|
+
|
25
|
+
``` bash
|
26
|
+
permpress checkstyle lint (--config=CONFIGURATION_FILE) [FILES]
|
27
|
+
permpress coffeelint lint (--config=CONFIGURATION_FILE) [FILES]
|
28
|
+
permpress csslint lint [FILES]
|
29
|
+
permpress golint lint (--config=CONFIGURATION_FILE) [FILES]
|
30
|
+
permpress jshint lint (--config=CONFIGURATION_FILE) [FILES]
|
31
|
+
permpress jsonlint lint (--config=CONFIGURATION_FILE) [FILES]
|
32
|
+
permpress rubocop lint (--config=CONFIGURATION_FILE) [FILES]
|
33
|
+
permpress scsslint lint (--config=CONFIGURATION_FILE) [FILES]
|
34
|
+
```
|
35
|
+
|
36
|
+
### Dependencies
|
37
|
+
|
38
|
+
* node/npm
|
39
|
+
* coffeelint
|
40
|
+
* csslint
|
41
|
+
* durable-json-lint-cli
|
42
|
+
* jshint
|
43
|
+
* java
|
44
|
+
* go
|
45
|
+
* golint
|
46
|
+
* ruby
|
47
|
+
* rubocop
|
48
|
+
* scsslint
|
49
|
+
|
50
|
+
## Contributing
|
51
|
+
|
52
|
+
1. Fork it ( https://github.com/[my-github-username]/permpress/fork )
|
53
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
54
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
55
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
56
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/bin/permpress
ADDED
data/lib/permpress.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require_relative 'command'
|
3
|
+
|
4
|
+
module Permpress
|
5
|
+
# Checkstyle subcommand. Calls Checkstyle with correct arguments.
|
6
|
+
class Checkstyle < Thor
|
7
|
+
JAR = File.expand_path('../checkstyle/checkstyle_logger-all.jar', __FILE__)
|
8
|
+
DEFAULT_CONFIG = File.expand_path('../checkstyle/sun_checks.xml', __FILE__)
|
9
|
+
|
10
|
+
desc 'lint [FILES]', 'Runs linter'
|
11
|
+
method_option :config, banner: 'CONFIG_FILE'
|
12
|
+
|
13
|
+
def lint(*files)
|
14
|
+
Command.new('java', files, flags).run
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def flags
|
20
|
+
[
|
21
|
+
'-jar', JAR,
|
22
|
+
'-c', options[:config] || DEFAULT_CONFIG
|
23
|
+
]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
Binary file
|
@@ -0,0 +1,177 @@
|
|
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
|
+
<module name="MethodLength"/>
|
113
|
+
<module name="ParameterNumber"/>
|
114
|
+
|
115
|
+
|
116
|
+
<!-- Checks for whitespace -->
|
117
|
+
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
|
118
|
+
<module name="EmptyForIteratorPad"/>
|
119
|
+
<module name="GenericWhitespace"/>
|
120
|
+
<module name="MethodParamPad"/>
|
121
|
+
<module name="NoWhitespaceAfter"/>
|
122
|
+
<module name="NoWhitespaceBefore"/>
|
123
|
+
<module name="OperatorWrap"/>
|
124
|
+
<module name="ParenPad"/>
|
125
|
+
<module name="TypecastParenPad"/>
|
126
|
+
<module name="WhitespaceAfter"/>
|
127
|
+
<module name="WhitespaceAround"/>
|
128
|
+
|
129
|
+
|
130
|
+
<!-- Modifier Checks -->
|
131
|
+
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
|
132
|
+
<module name="ModifierOrder"/>
|
133
|
+
<module name="RedundantModifier"/>
|
134
|
+
|
135
|
+
|
136
|
+
<!-- Checks for blocks. You know, those {}'s -->
|
137
|
+
<!-- See http://checkstyle.sf.net/config_blocks.html -->
|
138
|
+
<module name="AvoidNestedBlocks"/>
|
139
|
+
<module name="EmptyBlock"/>
|
140
|
+
<module name="LeftCurly"/>
|
141
|
+
<module name="NeedBraces"/>
|
142
|
+
<module name="RightCurly"/>
|
143
|
+
|
144
|
+
|
145
|
+
<!-- Checks for common coding problems -->
|
146
|
+
<!-- See http://checkstyle.sf.net/config_coding.html -->
|
147
|
+
<module name="AvoidInlineConditionals"/>
|
148
|
+
<module name="EmptyStatement"/>
|
149
|
+
<module name="EqualsHashCode"/>
|
150
|
+
<module name="HiddenField"/>
|
151
|
+
<module name="IllegalInstantiation"/>
|
152
|
+
<module name="InnerAssignment"/>
|
153
|
+
<module name="MagicNumber"/>
|
154
|
+
<module name="MissingSwitchDefault"/>
|
155
|
+
<module name="RedundantThrows"/>
|
156
|
+
<module name="SimplifyBooleanExpression"/>
|
157
|
+
<module name="SimplifyBooleanReturn"/>
|
158
|
+
|
159
|
+
<!-- Checks for class design -->
|
160
|
+
<!-- See http://checkstyle.sf.net/config_design.html -->
|
161
|
+
<module name="DesignForExtension"/>
|
162
|
+
<module name="FinalClass"/>
|
163
|
+
<module name="HideUtilityClassConstructor"/>
|
164
|
+
<module name="InterfaceIsType"/>
|
165
|
+
<module name="VisibilityModifier"/>
|
166
|
+
|
167
|
+
|
168
|
+
<!-- Miscellaneous other checks. -->
|
169
|
+
<!-- See http://checkstyle.sf.net/config_misc.html -->
|
170
|
+
<module name="ArrayTypeStyle"/>
|
171
|
+
<module name="FinalParameters"/>
|
172
|
+
<module name="TodoComment"/>
|
173
|
+
<module name="UpperEll"/>
|
174
|
+
|
175
|
+
</module>
|
176
|
+
|
177
|
+
</module>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'thor'
|
2
|
+
|
3
|
+
require_relative 'rubocop'
|
4
|
+
require_relative 'jshint'
|
5
|
+
require_relative 'jslint'
|
6
|
+
require_relative 'coffeelint'
|
7
|
+
require_relative 'golint'
|
8
|
+
require_relative 'govet'
|
9
|
+
require_relative 'checkstyle'
|
10
|
+
require_relative 'csslint'
|
11
|
+
require_relative 'scsslint'
|
12
|
+
require_relative 'jsonlint'
|
13
|
+
|
14
|
+
module Permpress
|
15
|
+
# Main CLI that controls all other linters
|
16
|
+
class CLI < Thor
|
17
|
+
# Ruby
|
18
|
+
register Permpress::RuboCop, 'rubocop', 'rubocop', 'Invokes Rubocop'
|
19
|
+
|
20
|
+
# JS
|
21
|
+
register Permpress::JSHint, 'jshint', 'jshint', 'Invokes JSHint'
|
22
|
+
# register Permpress::JSLint, 'jslint', 'jslint', 'Invokes JSLint'
|
23
|
+
|
24
|
+
# CoffeeScript
|
25
|
+
register Permpress::CoffeeLint, 'coffeelint', 'coffeelint', 'Invokes coffeelint'
|
26
|
+
|
27
|
+
# Go
|
28
|
+
register Permpress::GoLint, 'golint', 'golint', 'Invokes golint'
|
29
|
+
# register Permpress::GoVet, 'govet', 'govet', 'Invokes go vet'
|
30
|
+
|
31
|
+
# Java
|
32
|
+
register Permpress::Checkstyle, 'checkstyle', 'checkstyle', 'Invokes Checkstyle'
|
33
|
+
|
34
|
+
# CSS
|
35
|
+
register Permpress::CSSLint, 'csslint', 'csslint', 'Invokes csslint'
|
36
|
+
|
37
|
+
# SCSS
|
38
|
+
register Permpress::SCSSLint, 'scsslint', 'scsslint', 'Invokes scss-lint'
|
39
|
+
|
40
|
+
# JSON
|
41
|
+
register Permpress::JSONLint, 'jsonlint', 'jsonlint', 'Invokes durable-json-lint'
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require_relative 'command'
|
3
|
+
|
4
|
+
module Permpress
|
5
|
+
# CoffeLint subcommand. Calls CoffeeLint with correct arguments.
|
6
|
+
class CoffeeLint < Thor
|
7
|
+
FORMATTER_PATH = File.expand_path('../coffeelint/lintci.coffee', __FILE__)
|
8
|
+
|
9
|
+
desc 'lint [FILES]', 'Runs linter'
|
10
|
+
method_option :config, banner: 'CONFIG_FILE'
|
11
|
+
|
12
|
+
def lint(*files)
|
13
|
+
Command.new('coffeelint', files, flags).run
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def flags
|
19
|
+
[
|
20
|
+
"--reporter=#{FORMATTER_PATH}",
|
21
|
+
'--nocolor'
|
22
|
+
].tap do |flags|
|
23
|
+
flags.concat(["--file=#{options[:config]}"]) if options[:config]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module.exports = class LintCI
|
2
|
+
constructor: (@errorReport, options = {}) ->
|
3
|
+
|
4
|
+
publish: ->
|
5
|
+
for file, errors of @errorReport.paths
|
6
|
+
for error in errors
|
7
|
+
line = error.lineNumber
|
8
|
+
rule = error.rule
|
9
|
+
severity = error.level
|
10
|
+
message = error.message
|
11
|
+
|
12
|
+
console.log("#{file}:#{line}:::#{rule}:#{severity}:#{message}")
|