lint_trap 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Dockerfile +39 -32
- data/LICENSE.txt +362 -20
- data/README.md +26 -9
- data/lib/lint_trap/language/base.rb +6 -0
- data/lib/lint_trap/language/unknown.rb +23 -0
- data/lib/lint_trap/language.rb +7 -4
- data/lib/lint_trap/linter/base.rb +8 -0
- data/lib/lint_trap/linter/unknown.rb +22 -0
- data/lib/lint_trap/linter.rb +2 -1
- data/lib/lint_trap/version.rb +1 -1
- data/spec/language/unknown_spec.rb +19 -0
- data/spec/language_spec.rb +3 -3
- data/spec/linter/unknown_spec.rb +21 -0
- data/spec/linter_spec.rb +2 -2
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23aa32b336fd40453d65df5401d7247f0cd78e64
|
4
|
+
data.tar.gz: e12d4b7aa5daa29c71115a4899fac0349f412fa7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26a47d1550add4667f8df11d355b04350ba47bd31b815632bfbfb35a27743177ae5e2f21a8f49ec1d12653a9e02388c5a73de1602064fd8159057e0c9f413c80
|
7
|
+
data.tar.gz: 72571debf32931940a598b6893b4e120c578a844cf302c62b194e80bdcd50b1455a2e4643b73d68de868c61d3368caa6b1ea71e8c124410d09632a962b50db43
|
data/Dockerfile
CHANGED
@@ -6,10 +6,10 @@ ENV user spin_cycle
|
|
6
6
|
ENV group linters
|
7
7
|
ENV homedir /home/spin_cycle
|
8
8
|
|
9
|
-
RUN mkdir -p $homedir
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
RUN mkdir -p $homedir \
|
10
|
+
&& groupadd -r $group -g 777 \
|
11
|
+
&& useradd -u 666 -r -g $group -d $homedir -s /sbin/nologin -c "Docker image user" $user \
|
12
|
+
&& chown -R $user:$group $homedir
|
13
13
|
|
14
14
|
###### Packages
|
15
15
|
USER root
|
@@ -20,12 +20,12 @@ RUN apt-get update && apt-get install -y \
|
|
20
20
|
git \
|
21
21
|
mercurial \
|
22
22
|
subversion \
|
23
|
-
|
23
|
+
&& rm -rf /var/lib/apt/lists/*
|
24
24
|
|
25
25
|
RUN apt-get update && apt-get install -y \
|
26
26
|
curl \
|
27
27
|
wget \
|
28
|
-
|
28
|
+
&& rm -rf /var/lib/apt/lists/*
|
29
29
|
|
30
30
|
RUN apt-get update && apt-get install -y \
|
31
31
|
autoconf \
|
@@ -48,15 +48,17 @@ RUN apt-get update && apt-get install -y \
|
|
48
48
|
libxml2-dev \
|
49
49
|
libxslt-dev \
|
50
50
|
libyaml-dev \
|
51
|
+
python-software-properties \
|
52
|
+
software-properties-common \
|
51
53
|
zlib1g-dev \
|
52
|
-
|
54
|
+
&& rm -rf /var/lib/apt/lists/*
|
53
55
|
|
54
56
|
###### Languages
|
55
57
|
|
56
58
|
### Node.js
|
57
59
|
RUN apt-get update && apt-get install -y \
|
58
60
|
ca-certificates \
|
59
|
-
|
61
|
+
&& rm -rf /var/lib/apt/lists/*
|
60
62
|
|
61
63
|
# verify gpg and sha256: http://nodejs.org/dist/v0.10.31/SHASUMS256.txt.asc
|
62
64
|
# gpg: aka "Timothy J Fontaine (Work) <tj.fontaine@joyent.com>"
|
@@ -66,19 +68,19 @@ ENV NODE_VERSION 0.10.35
|
|
66
68
|
ENV NPM_VERSION 2.1.16
|
67
69
|
|
68
70
|
RUN curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz" \
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
71
|
+
&& curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
|
72
|
+
&& gpg --verify SHASUMS256.txt.asc \
|
73
|
+
&& grep " node-v$NODE_VERSION-linux-x64.tar.gz\$" SHASUMS256.txt.asc | sha256sum -c - \
|
74
|
+
&& tar -xzf "node-v$NODE_VERSION-linux-x64.tar.gz" -C /usr/local --strip-components=1 \
|
75
|
+
&& rm "node-v$NODE_VERSION-linux-x64.tar.gz" SHASUMS256.txt.asc \
|
76
|
+
&& npm install -g npm@"$NPM_VERSION" \
|
77
|
+
&& npm cache clear
|
76
78
|
|
77
79
|
### Ruby
|
78
80
|
RUN apt-get update && apt-get install -y \
|
79
81
|
curl \
|
80
82
|
procps \
|
81
|
-
|
83
|
+
&& rm -rf /var/lib/apt/lists/*
|
82
84
|
|
83
85
|
ENV RUBY_MAJOR 2.2
|
84
86
|
ENV RUBY_VERSION 2.2.0
|
@@ -86,11 +88,13 @@ ENV RUBY_VERSION 2.2.0
|
|
86
88
|
# some of ruby's build scripts are written in ruby
|
87
89
|
# we purge this later to make sure our final image uses what we just built
|
88
90
|
RUN apt-get update \
|
89
|
-
&& apt-get install -y
|
91
|
+
&& apt-get install -y \
|
92
|
+
bison \
|
93
|
+
ruby \
|
90
94
|
&& rm -rf /var/lib/apt/lists/* \
|
91
95
|
&& mkdir -p /usr/src/ruby \
|
92
96
|
&& curl -SL "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.bz2" \
|
93
|
-
|
97
|
+
| tar -xjC /usr/src/ruby --strip-components=1 \
|
94
98
|
&& cd /usr/src/ruby \
|
95
99
|
&& autoconf \
|
96
100
|
&& ./configure --disable-install-doc \
|
@@ -103,21 +107,22 @@ RUN apt-get update \
|
|
103
107
|
RUN echo 'gem: --no-rdoc --no-ri' >> "$HOME/.gemrc"
|
104
108
|
|
105
109
|
### Java
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
+
RUN echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true \
|
111
|
+
| debconf-set-selections \
|
112
|
+
&& add-apt-repository -y ppa:webupd8team/java \
|
113
|
+
&& apt-get update \
|
110
114
|
&& apt-get install -y \
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
wget \
|
115
|
-
&& rm -rf /var/lib/apt/lists/*
|
115
|
+
oracle-java7-installer \
|
116
|
+
&& rm -rf /var/lib/apt/lists/* \
|
117
|
+
&& rm -rf /var/cache/oracle-jdk7-installer
|
116
118
|
|
119
|
+
# Define commonly used JAVA_HOME variable
|
120
|
+
ENV JAVA_HOME /usr/lib/jvm/java-7-oracle
|
117
121
|
|
118
122
|
### Go
|
119
123
|
# SCMs for "go get", gcc for cgo
|
120
|
-
RUN apt-get update
|
124
|
+
RUN apt-get update
|
125
|
+
&& apt-get install -y \
|
121
126
|
ca-certificates \
|
122
127
|
curl \
|
123
128
|
gcc \
|
@@ -131,7 +136,8 @@ RUN apt-get update && apt-get install -y \
|
|
131
136
|
|
132
137
|
ENV GOLANG_VERSION 1.4
|
133
138
|
|
134
|
-
RUN curl -sSL https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz
|
139
|
+
RUN curl -sSL https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz \
|
140
|
+
| tar -v -C /usr/src -xz \
|
135
141
|
&& cd /usr/src/go/src \
|
136
142
|
&& ./make.bash --no-clean 2>&1
|
137
143
|
|
@@ -154,7 +160,7 @@ ENV PYTHON_VERSION 2.7.9
|
|
154
160
|
RUN set -x \
|
155
161
|
&& mkdir -p /usr/src/python \
|
156
162
|
&& curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" \
|
157
|
-
|
163
|
+
| tar -xJC /usr/src/python --strip-components=1 \
|
158
164
|
&& cd /usr/src/python \
|
159
165
|
&& ./configure --enable-shared \
|
160
166
|
&& make -j$(nproc) \
|
@@ -172,9 +178,10 @@ RUN set -x \
|
|
172
178
|
### CPPCheck
|
173
179
|
ENV CPPCHECK_VERSION 1.61-1
|
174
180
|
|
175
|
-
RUN apt-get update
|
181
|
+
RUN apt-get update \
|
182
|
+
&& apt-get install -y \
|
176
183
|
cppcheck=$CPPCHECK_VERSION \
|
177
|
-
|
184
|
+
&& rm -rf /var/lib/apt/lists/*
|
178
185
|
|
179
186
|
### GoLint
|
180
187
|
RUN go get github.com/golang/lint/golint
|
data/LICENSE.txt
CHANGED
@@ -1,22 +1,364 @@
|
|
1
1
|
Copyright (c) 2014 Allen Madsen
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
"
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
3
|
+
Mozilla Public License, version 2.0
|
4
|
+
|
5
|
+
1. Definitions
|
6
|
+
|
7
|
+
1.1. "Contributor"
|
8
|
+
|
9
|
+
means each individual or legal entity that creates, contributes to the
|
10
|
+
creation of, or owns Covered Software.
|
11
|
+
|
12
|
+
1.2. "Contributor Version"
|
13
|
+
|
14
|
+
means the combination of the Contributions of others (if any) used by a
|
15
|
+
Contributor and that particular Contributor's Contribution.
|
16
|
+
|
17
|
+
1.3. "Contribution"
|
18
|
+
|
19
|
+
means Covered Software of a particular Contributor.
|
20
|
+
|
21
|
+
1.4. "Covered Software"
|
22
|
+
|
23
|
+
means Source Code Form to which the initial Contributor has attached the
|
24
|
+
notice in Exhibit A, the Executable Form of such Source Code Form, and
|
25
|
+
Modifications of such Source Code Form, in each case including portions
|
26
|
+
thereof.
|
27
|
+
|
28
|
+
1.5. "Incompatible With Secondary Licenses"
|
29
|
+
means
|
30
|
+
|
31
|
+
a. that the initial Contributor has attached the notice described in
|
32
|
+
Exhibit B to the Covered Software; or
|
33
|
+
|
34
|
+
b. that the Covered Software was made available under the terms of
|
35
|
+
version 1.1 or earlier of the License, but not also under the terms of
|
36
|
+
a Secondary License.
|
37
|
+
|
38
|
+
1.6. "Executable Form"
|
39
|
+
|
40
|
+
means any form of the work other than Source Code Form.
|
41
|
+
|
42
|
+
1.7. "Larger Work"
|
43
|
+
|
44
|
+
means a work that combines Covered Software with other material, in a
|
45
|
+
separate file or files, that is not Covered Software.
|
46
|
+
|
47
|
+
1.8. "License"
|
48
|
+
|
49
|
+
means this document.
|
50
|
+
|
51
|
+
1.9. "Licensable"
|
52
|
+
|
53
|
+
means having the right to grant, to the maximum extent possible, whether
|
54
|
+
at the time of the initial grant or subsequently, any and all of the
|
55
|
+
rights conveyed by this License.
|
56
|
+
|
57
|
+
1.10. "Modifications"
|
58
|
+
|
59
|
+
means any of the following:
|
60
|
+
|
61
|
+
a. any file in Source Code Form that results from an addition to,
|
62
|
+
deletion from, or modification of the contents of Covered Software; or
|
63
|
+
|
64
|
+
b. any new file in Source Code Form that contains any Covered Software.
|
65
|
+
|
66
|
+
1.11. "Patent Claims" of a Contributor
|
67
|
+
|
68
|
+
means any patent claim(s), including without limitation, method,
|
69
|
+
process, and apparatus claims, in any patent Licensable by such
|
70
|
+
Contributor that would be infringed, but for the grant of the License,
|
71
|
+
by the making, using, selling, offering for sale, having made, import,
|
72
|
+
or transfer of either its Contributions or its Contributor Version.
|
73
|
+
|
74
|
+
1.12. "Secondary License"
|
75
|
+
|
76
|
+
means either the GNU General Public License, Version 2.0, the GNU Lesser
|
77
|
+
General Public License, Version 2.1, the GNU Affero General Public
|
78
|
+
License, Version 3.0, or any later versions of those licenses.
|
79
|
+
|
80
|
+
1.13. "Source Code Form"
|
81
|
+
|
82
|
+
means the form of the work preferred for making modifications.
|
83
|
+
|
84
|
+
1.14. "You" (or "Your")
|
85
|
+
|
86
|
+
means an individual or a legal entity exercising rights under this
|
87
|
+
License. For legal entities, "You" includes any entity that controls, is
|
88
|
+
controlled by, or is under common control with You. For purposes of this
|
89
|
+
definition, "control" means (a) the power, direct or indirect, to cause
|
90
|
+
the direction or management of such entity, whether by contract or
|
91
|
+
otherwise, or (b) ownership of more than fifty percent (50%) of the
|
92
|
+
outstanding shares or beneficial ownership of such entity.
|
93
|
+
|
94
|
+
|
95
|
+
2. License Grants and Conditions
|
96
|
+
|
97
|
+
2.1. Grants
|
98
|
+
|
99
|
+
Each Contributor hereby grants You a world-wide, royalty-free,
|
100
|
+
non-exclusive license:
|
101
|
+
|
102
|
+
a. under intellectual property rights (other than patent or trademark)
|
103
|
+
Licensable by such Contributor to use, reproduce, make available,
|
104
|
+
modify, display, perform, distribute, and otherwise exploit its
|
105
|
+
Contributions, either on an unmodified basis, with Modifications, or
|
106
|
+
as part of a Larger Work; and
|
107
|
+
|
108
|
+
b. under Patent Claims of such Contributor to make, use, sell, offer for
|
109
|
+
sale, have made, import, and otherwise transfer either its
|
110
|
+
Contributions or its Contributor Version.
|
111
|
+
|
112
|
+
2.2. Effective Date
|
113
|
+
|
114
|
+
The licenses granted in Section 2.1 with respect to any Contribution
|
115
|
+
become effective for each Contribution on the date the Contributor first
|
116
|
+
distributes such Contribution.
|
117
|
+
|
118
|
+
2.3. Limitations on Grant Scope
|
119
|
+
|
120
|
+
The licenses granted in this Section 2 are the only rights granted under
|
121
|
+
this License. No additional rights or licenses will be implied from the
|
122
|
+
distribution or licensing of Covered Software under this License.
|
123
|
+
Notwithstanding Section 2.1(b) above, no patent license is granted by a
|
124
|
+
Contributor:
|
125
|
+
|
126
|
+
a. for any code that a Contributor has removed from Covered Software; or
|
127
|
+
|
128
|
+
b. for infringements caused by: (i) Your and any other third party's
|
129
|
+
modifications of Covered Software, or (ii) the combination of its
|
130
|
+
Contributions with other software (except as part of its Contributor
|
131
|
+
Version); or
|
132
|
+
|
133
|
+
c. under Patent Claims infringed by Covered Software in the absence of
|
134
|
+
its Contributions.
|
135
|
+
|
136
|
+
This License does not grant any rights in the trademarks, service marks,
|
137
|
+
or logos of any Contributor (except as may be necessary to comply with
|
138
|
+
the notice requirements in Section 3.4).
|
139
|
+
|
140
|
+
2.4. Subsequent Licenses
|
141
|
+
|
142
|
+
No Contributor makes additional grants as a result of Your choice to
|
143
|
+
distribute the Covered Software under a subsequent version of this
|
144
|
+
License (see Section 10.2) or under the terms of a Secondary License (if
|
145
|
+
permitted under the terms of Section 3.3).
|
146
|
+
|
147
|
+
2.5. Representation
|
148
|
+
|
149
|
+
Each Contributor represents that the Contributor believes its
|
150
|
+
Contributions are its original creation(s) or it has sufficient rights to
|
151
|
+
grant the rights to its Contributions conveyed by this License.
|
152
|
+
|
153
|
+
2.6. Fair Use
|
154
|
+
|
155
|
+
This License is not intended to limit any rights You have under
|
156
|
+
applicable copyright doctrines of fair use, fair dealing, or other
|
157
|
+
equivalents.
|
158
|
+
|
159
|
+
2.7. Conditions
|
160
|
+
|
161
|
+
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
|
162
|
+
Section 2.1.
|
163
|
+
|
164
|
+
|
165
|
+
3. Responsibilities
|
166
|
+
|
167
|
+
3.1. Distribution of Source Form
|
168
|
+
|
169
|
+
All distribution of Covered Software in Source Code Form, including any
|
170
|
+
Modifications that You create or to which You contribute, must be under
|
171
|
+
the terms of this License. You must inform recipients that the Source
|
172
|
+
Code Form of the Covered Software is governed by the terms of this
|
173
|
+
License, and how they can obtain a copy of this License. You may not
|
174
|
+
attempt to alter or restrict the recipients' rights in the Source Code
|
175
|
+
Form.
|
176
|
+
|
177
|
+
3.2. Distribution of Executable Form
|
178
|
+
|
179
|
+
If You distribute Covered Software in Executable Form then:
|
180
|
+
|
181
|
+
a. such Covered Software must also be made available in Source Code Form,
|
182
|
+
as described in Section 3.1, and You must inform recipients of the
|
183
|
+
Executable Form how they can obtain a copy of such Source Code Form by
|
184
|
+
reasonable means in a timely manner, at a charge no more than the cost
|
185
|
+
of distribution to the recipient; and
|
186
|
+
|
187
|
+
b. You may distribute such Executable Form under the terms of this
|
188
|
+
License, or sublicense it under different terms, provided that the
|
189
|
+
license for the Executable Form does not attempt to limit or alter the
|
190
|
+
recipients' rights in the Source Code Form under this License.
|
191
|
+
|
192
|
+
3.3. Distribution of a Larger Work
|
193
|
+
|
194
|
+
You may create and distribute a Larger Work under terms of Your choice,
|
195
|
+
provided that You also comply with the requirements of this License for
|
196
|
+
the Covered Software. If the Larger Work is a combination of Covered
|
197
|
+
Software with a work governed by one or more Secondary Licenses, and the
|
198
|
+
Covered Software is not Incompatible With Secondary Licenses, this
|
199
|
+
License permits You to additionally distribute such Covered Software
|
200
|
+
under the terms of such Secondary License(s), so that the recipient of
|
201
|
+
the Larger Work may, at their option, further distribute the Covered
|
202
|
+
Software under the terms of either this License or such Secondary
|
203
|
+
License(s).
|
204
|
+
|
205
|
+
3.4. Notices
|
206
|
+
|
207
|
+
You may not remove or alter the substance of any license notices
|
208
|
+
(including copyright notices, patent notices, disclaimers of warranty, or
|
209
|
+
limitations of liability) contained within the Source Code Form of the
|
210
|
+
Covered Software, except that You may alter any license notices to the
|
211
|
+
extent required to remedy known factual inaccuracies.
|
212
|
+
|
213
|
+
3.5. Application of Additional Terms
|
214
|
+
|
215
|
+
You may choose to offer, and to charge a fee for, warranty, support,
|
216
|
+
indemnity or liability obligations to one or more recipients of Covered
|
217
|
+
Software. However, You may do so only on Your own behalf, and not on
|
218
|
+
behalf of any Contributor. You must make it absolutely clear that any
|
219
|
+
such warranty, support, indemnity, or liability obligation is offered by
|
220
|
+
You alone, and You hereby agree to indemnify every Contributor for any
|
221
|
+
liability incurred by such Contributor as a result of warranty, support,
|
222
|
+
indemnity or liability terms You offer. You may include additional
|
223
|
+
disclaimers of warranty and limitations of liability specific to any
|
224
|
+
jurisdiction.
|
225
|
+
|
226
|
+
4. Inability to Comply Due to Statute or Regulation
|
227
|
+
|
228
|
+
If it is impossible for You to comply with any of the terms of this License
|
229
|
+
with respect to some or all of the Covered Software due to statute,
|
230
|
+
judicial order, or regulation then You must: (a) comply with the terms of
|
231
|
+
this License to the maximum extent possible; and (b) describe the
|
232
|
+
limitations and the code they affect. Such description must be placed in a
|
233
|
+
text file included with all distributions of the Covered Software under
|
234
|
+
this License. Except to the extent prohibited by statute or regulation,
|
235
|
+
such description must be sufficiently detailed for a recipient of ordinary
|
236
|
+
skill to be able to understand it.
|
237
|
+
|
238
|
+
5. Termination
|
239
|
+
|
240
|
+
5.1. The rights granted under this License will terminate automatically if You
|
241
|
+
fail to comply with any of its terms. However, if You become compliant,
|
242
|
+
then the rights granted under this License from a particular Contributor
|
243
|
+
are reinstated (a) provisionally, unless and until such Contributor
|
244
|
+
explicitly and finally terminates Your grants, and (b) on an ongoing
|
245
|
+
basis, if such Contributor fails to notify You of the non-compliance by
|
246
|
+
some reasonable means prior to 60 days after You have come back into
|
247
|
+
compliance. Moreover, Your grants from a particular Contributor are
|
248
|
+
reinstated on an ongoing basis if such Contributor notifies You of the
|
249
|
+
non-compliance by some reasonable means, this is the first time You have
|
250
|
+
received notice of non-compliance with this License from such
|
251
|
+
Contributor, and You become compliant prior to 30 days after Your receipt
|
252
|
+
of the notice.
|
253
|
+
|
254
|
+
5.2. If You initiate litigation against any entity by asserting a patent
|
255
|
+
infringement claim (excluding declaratory judgment actions,
|
256
|
+
counter-claims, and cross-claims) alleging that a Contributor Version
|
257
|
+
directly or indirectly infringes any patent, then the rights granted to
|
258
|
+
You by any and all Contributors for the Covered Software under Section
|
259
|
+
2.1 of this License shall terminate.
|
260
|
+
|
261
|
+
5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
|
262
|
+
license agreements (excluding distributors and resellers) which have been
|
263
|
+
validly granted by You or Your distributors under this License prior to
|
264
|
+
termination shall survive termination.
|
265
|
+
|
266
|
+
6. Disclaimer of Warranty
|
267
|
+
|
268
|
+
Covered Software is provided under this License on an "as is" basis,
|
269
|
+
without warranty of any kind, either expressed, implied, or statutory,
|
270
|
+
including, without limitation, warranties that the Covered Software is free
|
271
|
+
of defects, merchantable, fit for a particular purpose or non-infringing.
|
272
|
+
The entire risk as to the quality and performance of the Covered Software
|
273
|
+
is with You. Should any Covered Software prove defective in any respect,
|
274
|
+
You (not any Contributor) assume the cost of any necessary servicing,
|
275
|
+
repair, or correction. This disclaimer of warranty constitutes an essential
|
276
|
+
part of this License. No use of any Covered Software is authorized under
|
277
|
+
this License except under this disclaimer.
|
278
|
+
|
279
|
+
7. Limitation of Liability
|
280
|
+
|
281
|
+
Under no circumstances and under no legal theory, whether tort (including
|
282
|
+
negligence), contract, or otherwise, shall any Contributor, or anyone who
|
283
|
+
distributes Covered Software as permitted above, be liable to You for any
|
284
|
+
direct, indirect, special, incidental, or consequential damages of any
|
285
|
+
character including, without limitation, damages for lost profits, loss of
|
286
|
+
goodwill, work stoppage, computer failure or malfunction, or any and all
|
287
|
+
other commercial damages or losses, even if such party shall have been
|
288
|
+
informed of the possibility of such damages. This limitation of liability
|
289
|
+
shall not apply to liability for death or personal injury resulting from
|
290
|
+
such party's negligence to the extent applicable law prohibits such
|
291
|
+
limitation. Some jurisdictions do not allow the exclusion or limitation of
|
292
|
+
incidental or consequential damages, so this exclusion and limitation may
|
293
|
+
not apply to You.
|
294
|
+
|
295
|
+
8. Litigation
|
296
|
+
|
297
|
+
Any litigation relating to this License may be brought only in the courts
|
298
|
+
of a jurisdiction where the defendant maintains its principal place of
|
299
|
+
business and such litigation shall be governed by laws of that
|
300
|
+
jurisdiction, without reference to its conflict-of-law provisions. Nothing
|
301
|
+
in this Section shall prevent a party's ability to bring cross-claims or
|
302
|
+
counter-claims.
|
303
|
+
|
304
|
+
9. Miscellaneous
|
305
|
+
|
306
|
+
This License represents the complete agreement concerning the subject
|
307
|
+
matter hereof. If any provision of this License is held to be
|
308
|
+
unenforceable, such provision shall be reformed only to the extent
|
309
|
+
necessary to make it enforceable. Any law or regulation which provides that
|
310
|
+
the language of a contract shall be construed against the drafter shall not
|
311
|
+
be used to construe this License against a Contributor.
|
312
|
+
|
313
|
+
|
314
|
+
10. Versions of the License
|
315
|
+
|
316
|
+
10.1. New Versions
|
317
|
+
|
318
|
+
Mozilla Foundation is the license steward. Except as provided in Section
|
319
|
+
10.3, no one other than the license steward has the right to modify or
|
320
|
+
publish new versions of this License. Each version will be given a
|
321
|
+
distinguishing version number.
|
322
|
+
|
323
|
+
10.2. Effect of New Versions
|
324
|
+
|
325
|
+
You may distribute the Covered Software under the terms of the version
|
326
|
+
of the License under which You originally received the Covered Software,
|
327
|
+
or under the terms of any subsequent version published by the license
|
328
|
+
steward.
|
329
|
+
|
330
|
+
10.3. Modified Versions
|
331
|
+
|
332
|
+
If you create software not governed by this License, and you want to
|
333
|
+
create a new license for such software, you may create and use a
|
334
|
+
modified version of this License if you rename the license and remove
|
335
|
+
any references to the name of the license steward (except to note that
|
336
|
+
such modified license differs from this License).
|
337
|
+
|
338
|
+
10.4. Distributing Source Code Form that is Incompatible With Secondary
|
339
|
+
Licenses If You choose to distribute Source Code Form that is
|
340
|
+
Incompatible With Secondary Licenses under the terms of this version of
|
341
|
+
the License, the notice described in Exhibit B of this License must be
|
342
|
+
attached.
|
343
|
+
|
344
|
+
Exhibit A - Source Code Form License Notice
|
345
|
+
|
346
|
+
This Source Code Form is subject to the
|
347
|
+
terms of the Mozilla Public License, v.
|
348
|
+
2.0. If a copy of the MPL was not
|
349
|
+
distributed with this file, You can
|
350
|
+
obtain one at
|
351
|
+
http://mozilla.org/MPL/2.0/.
|
352
|
+
|
353
|
+
If it is not possible or desirable to put the notice in a particular file,
|
354
|
+
then You may include the notice in a location (such as a LICENSE file in a
|
355
|
+
relevant directory) where a recipient would be likely to look for such a
|
356
|
+
notice.
|
357
|
+
|
358
|
+
You may add additional accurate notices of copyright ownership.
|
359
|
+
|
360
|
+
Exhibit B - "Incompatible With Secondary Licenses" Notice
|
361
|
+
|
362
|
+
This Source Code Form is "Incompatible
|
363
|
+
With Secondary Licenses", as defined by
|
364
|
+
the Mozilla Public License, v. 2.0.
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# LintTrap
|
2
2
|
|
3
|
-
[
|
3
|
+
[![Circle CI](https://circleci.com/gh/lintci/lint_trap.svg?style=svg)](https://circleci.com/gh/lintci/lint_trap)
|
4
4
|
|
5
|
-
|
5
|
+
Detects languages of files, determines appropriate linters, and runs then. Created for [LintCI](http://www.lintci.com).
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -22,19 +22,36 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
+
### Language Detection
|
26
|
+
|
25
27
|
``` ruby
|
26
28
|
require 'lint_trap'
|
27
|
-
require 'stringio'
|
28
29
|
|
29
|
-
|
30
|
-
|
30
|
+
language = LintTrap::Language.detect('bad.rb')
|
31
|
+
language.name #=> 'Ruby'
|
32
|
+
language.linters #=> [<Rubocop>]
|
33
|
+
```
|
34
|
+
|
35
|
+
### Linting
|
36
|
+
|
37
|
+
``` ruby
|
38
|
+
require 'lint_trap'
|
31
39
|
|
32
|
-
LintTrap.
|
33
|
-
|
40
|
+
container = LintTrap::Container::Docker.new('lintci/lint_trap')
|
41
|
+
linter = LintTrap::Linter.find('RuboCop')
|
42
|
+
|
43
|
+
linter.run(['bad.rb'], container, {}) do |violation|
|
44
|
+
violation #=> {
|
45
|
+
# file: 'bad.rb',
|
46
|
+
# line: '2',
|
47
|
+
# column: '7',
|
48
|
+
# length: '4',
|
49
|
+
# rule: 'Style/MethodName',
|
50
|
+
# severity: 'convention',
|
51
|
+
# message: 'Use snake_case for methods.'
|
52
|
+
# }
|
34
53
|
end
|
35
54
|
|
36
|
-
# Output
|
37
|
-
# {:file=>"bad.rb", :line=>"2", :column=>"7", :length=>"4", :rule=>"Style/MethodName", :severity=>"convention", :message=>"Use snake_case for methods."}
|
38
55
|
```
|
39
56
|
|
40
57
|
## Contributing
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require_relative 'base'
|
2
|
+
require_relative '../linter/unknown'
|
3
|
+
|
4
|
+
module LintTrap
|
5
|
+
module Language
|
6
|
+
# Interface for languages
|
7
|
+
class Unknown < Base
|
8
|
+
attr_reader :name
|
9
|
+
|
10
|
+
def initialize(name = 'Unknown')
|
11
|
+
@name = name
|
12
|
+
end
|
13
|
+
|
14
|
+
def linters
|
15
|
+
super(Linter::Unknown)
|
16
|
+
end
|
17
|
+
|
18
|
+
def known?
|
19
|
+
false
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/lint_trap/language.rb
CHANGED
@@ -10,6 +10,7 @@ require_relative 'language/json'
|
|
10
10
|
require_relative 'language/python'
|
11
11
|
require_relative 'language/ruby'
|
12
12
|
require_relative 'language/scss'
|
13
|
+
require_relative 'language/unknown'
|
13
14
|
|
14
15
|
module LintTrap
|
15
16
|
# Language lookup
|
@@ -23,13 +24,15 @@ module LintTrap
|
|
23
24
|
end
|
24
25
|
|
25
26
|
def detect(file)
|
26
|
-
language = Linguist::FileBlob.new(file).language
|
27
|
-
|
28
|
-
|
27
|
+
if (language = Linguist::FileBlob.new(file).language)
|
28
|
+
find(language.name)
|
29
|
+
else
|
30
|
+
Unknown.new
|
31
|
+
end
|
29
32
|
end
|
30
33
|
|
31
34
|
def find(name)
|
32
|
-
languages[name]
|
35
|
+
languages[name] || Unknown.new(name)
|
33
36
|
end
|
34
37
|
|
35
38
|
protected
|
@@ -8,6 +8,8 @@ module LintTrap
|
|
8
8
|
CONFIG_PATH = File.expand_path('../../../../config', __FILE__)
|
9
9
|
|
10
10
|
def lint(files, container, options)
|
11
|
+
return unless known?
|
12
|
+
|
11
13
|
@container, @options = container, options
|
12
14
|
|
13
15
|
command(files).run(container) do |stdout|
|
@@ -25,7 +27,13 @@ module LintTrap
|
|
25
27
|
classes.map(&:new)
|
26
28
|
end
|
27
29
|
|
30
|
+
def known?
|
31
|
+
true
|
32
|
+
end
|
33
|
+
|
28
34
|
def ==(other)
|
35
|
+
return false unless other.respond_to?(:name, true)
|
36
|
+
|
29
37
|
name == other.name
|
30
38
|
end
|
31
39
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require_relative 'base'
|
2
|
+
|
3
|
+
module LintTrap
|
4
|
+
module Linter
|
5
|
+
# Encapsulates logic specific to scsslint command line tool.
|
6
|
+
class Unknown < Base
|
7
|
+
attr_reader :name
|
8
|
+
|
9
|
+
def initialize(name = 'Unknown')
|
10
|
+
@name = name
|
11
|
+
end
|
12
|
+
|
13
|
+
def languages
|
14
|
+
super(Language::Unknown)
|
15
|
+
end
|
16
|
+
|
17
|
+
def known?
|
18
|
+
false
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/lint_trap/linter.rb
CHANGED
@@ -8,11 +8,12 @@ require_relative 'linter/jsonlint'
|
|
8
8
|
require_relative 'linter/pylint'
|
9
9
|
require_relative 'linter/rubocop'
|
10
10
|
require_relative 'linter/scsslint'
|
11
|
+
require_relative 'linter/unknown'
|
11
12
|
|
12
13
|
module LintTrap
|
13
14
|
# Linter lookup
|
14
15
|
module Linter
|
15
|
-
@linters = {}
|
16
|
+
@linters = Hash.new{|h, v| h[v] = Unknown.new(v)}
|
16
17
|
|
17
18
|
class << self
|
18
19
|
def register(linter_class)
|
data/lib/lint_trap/version.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe LintTrap::Language::Unknown do
|
4
|
+
subject(:language){described_class.new}
|
5
|
+
|
6
|
+
it_behaves_like 'language'
|
7
|
+
|
8
|
+
context 'when no name is passed' do
|
9
|
+
its(:name){is_expected.to eq('Unknown')}
|
10
|
+
end
|
11
|
+
|
12
|
+
context 'when a name is passed' do
|
13
|
+
subject(:language){described_class.new('Huh')}
|
14
|
+
|
15
|
+
its(:name){is_expected.to eq('Huh')}
|
16
|
+
end
|
17
|
+
|
18
|
+
its(:linters){is_expected.to eq([LintTrap::Linter::Unknown.new])}
|
19
|
+
end
|
data/spec/language_spec.rb
CHANGED
@@ -67,14 +67,14 @@ describe LintTrap::Language do
|
|
67
67
|
context 'when given an unknown language file' do
|
68
68
|
let(:file){fixture_path('lint.txt')}
|
69
69
|
|
70
|
-
it{is_expected.to eq(
|
70
|
+
it{is_expected.to eq(described_class::Unknown.new('Text'))}
|
71
71
|
end
|
72
72
|
|
73
73
|
context 'when given a known language file that is empty' do
|
74
74
|
let(:file){fixture_path('empty.rb')}
|
75
75
|
|
76
76
|
# Linguist can't figure out what language the empty file is
|
77
|
-
it{is_expected.to eq(
|
77
|
+
it{is_expected.to eq(described_class::Unknown.new)}
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
@@ -144,7 +144,7 @@ describe LintTrap::Language do
|
|
144
144
|
context 'when given an invalid language' do
|
145
145
|
let(:language_name){'invalid language'}
|
146
146
|
|
147
|
-
it{is_expected.to eq(
|
147
|
+
it{is_expected.to eq(described_class::Unknown.new(language_name))}
|
148
148
|
end
|
149
149
|
end
|
150
150
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe LintTrap::Linter::Unknown do
|
4
|
+
let(:container){LintTrap::Container::Fake.new}
|
5
|
+
let(:options){{}}
|
6
|
+
let(:files){%w(good.un bad.un)}
|
7
|
+
subject(:linter){described_class.new}
|
8
|
+
let(:command){instance_double(LintTrap::Command)}
|
9
|
+
|
10
|
+
it_behaves_like 'linter'
|
11
|
+
|
12
|
+
its(:languages){is_expected.to eq([LintTrap::Language::Unknown.new])}
|
13
|
+
|
14
|
+
describe '#lint' do
|
15
|
+
it 'is a noop' do
|
16
|
+
expect(LintTrap::Command).to_not receive(:new)
|
17
|
+
|
18
|
+
linter.lint(files, container, options)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/spec/linter_spec.rb
CHANGED
@@ -64,10 +64,10 @@ describe LintTrap::Linter do
|
|
64
64
|
it{is_expected.to be_a(described_class::SCSSLint)}
|
65
65
|
end
|
66
66
|
|
67
|
-
context 'when given an
|
67
|
+
context 'when given an unknown linter' do
|
68
68
|
let(:linter_name){'taco cheese'}
|
69
69
|
|
70
|
-
it{is_expected.to eq(
|
70
|
+
it{is_expected.to eq(described_class::Unknown.new(linter_name))}
|
71
71
|
end
|
72
72
|
end
|
73
73
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lint_trap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Allen Madsen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: github-linguist
|
@@ -133,6 +133,7 @@ files:
|
|
133
133
|
- lib/lint_trap/language/python.rb
|
134
134
|
- lib/lint_trap/language/ruby.rb
|
135
135
|
- lib/lint_trap/language/scss.rb
|
136
|
+
- lib/lint_trap/language/unknown.rb
|
136
137
|
- lib/lint_trap/linter.rb
|
137
138
|
- lib/lint_trap/linter/base.rb
|
138
139
|
- lib/lint_trap/linter/checkstyle.rb
|
@@ -145,6 +146,7 @@ files:
|
|
145
146
|
- lib/lint_trap/linter/pylint.rb
|
146
147
|
- lib/lint_trap/linter/rubocop.rb
|
147
148
|
- lib/lint_trap/linter/scsslint.rb
|
149
|
+
- lib/lint_trap/linter/unknown.rb
|
148
150
|
- lib/lint_trap/parser/base.rb
|
149
151
|
- lib/lint_trap/parser/csslint.rb
|
150
152
|
- lib/lint_trap/parser/line.rb
|
@@ -197,6 +199,7 @@ files:
|
|
197
199
|
- spec/language/python_spec.rb
|
198
200
|
- spec/language/ruby_spec.rb
|
199
201
|
- spec/language/scss_spec.rb
|
202
|
+
- spec/language/unknown_spec.rb
|
200
203
|
- spec/language_spec.rb
|
201
204
|
- spec/lint_trap_spec.rb
|
202
205
|
- spec/linter/checkstyle_spec.rb
|
@@ -209,6 +212,7 @@ files:
|
|
209
212
|
- spec/linter/pylint_spec.rb
|
210
213
|
- spec/linter/rubocop_spec.rb
|
211
214
|
- spec/linter/scsslint_spec.rb
|
215
|
+
- spec/linter/unknown_spec.rb
|
212
216
|
- spec/linter_spec.rb
|
213
217
|
- spec/parser/csslint_spec.rb
|
214
218
|
- spec/parser/standard_spec.rb
|
@@ -287,6 +291,7 @@ test_files:
|
|
287
291
|
- spec/language/python_spec.rb
|
288
292
|
- spec/language/ruby_spec.rb
|
289
293
|
- spec/language/scss_spec.rb
|
294
|
+
- spec/language/unknown_spec.rb
|
290
295
|
- spec/language_spec.rb
|
291
296
|
- spec/lint_trap_spec.rb
|
292
297
|
- spec/linter/checkstyle_spec.rb
|
@@ -299,6 +304,7 @@ test_files:
|
|
299
304
|
- spec/linter/pylint_spec.rb
|
300
305
|
- spec/linter/rubocop_spec.rb
|
301
306
|
- spec/linter/scsslint_spec.rb
|
307
|
+
- spec/linter/unknown_spec.rb
|
302
308
|
- spec/linter_spec.rb
|
303
309
|
- spec/parser/csslint_spec.rb
|
304
310
|
- spec/parser/standard_spec.rb
|