Skip to content

Commit

Permalink
Fix text lint issues
Browse files Browse the repository at this point in the history
Summary: Ref T5105. This is a proof-of-concept for D11458.

Test Plan: `arc lint --everything`

Reviewers: chad, #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T5105

Differential Revision: https://secure.phabricator.com/D11640
  • Loading branch information
joshuaspence committed Apr 7, 2015
1 parent 3a5ffdc commit f2a3fdf
Show file tree
Hide file tree
Showing 22 changed files with 84 additions and 65 deletions.
17 changes: 2 additions & 15 deletions .arclint
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"exclude": [
"(^externals/)",
"(\\.lint-test$)"
"(^externals/)"
],
"linters": {
"chmod": {
Expand Down Expand Up @@ -41,19 +40,7 @@
"exclude": "(^resources/spelling/.*\\.json$)"
},
"text": {
"type": "text",
"exclude": [
"(^\\.arclint$)"
]
},
"text-without-length": {
"type": "text",
"severity": {
"3": "disabled"
},
"include": [
"(^\\.arclint$)"
]
"type": "text"
},
"xhpast": {
"type": "xhpast",
Expand Down
32 changes: 29 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,50 @@
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 80

[src/lint/linter/__tests__/**.lint-test]
indent_style =
end_of_line =
max_line_length =
trim_trailing_whitespace =

[src/parser/__tests__/bundle/*]
trim_trailing_whitespace = false
insert_final_newline = false

[src/parser/__tests__/diff/*.{git,hg,svn,u}diff]
[src/parser/__tests__/diff/*.{git,hg,rcs,svn,u}diff]
indent_style =
trim_trailing_whitespace = false
insert_final_newline = false
max_line_length =

[src/parser/__tests__/patches/*.{git,hg,rcs,svn,u}patch]
indent_style =
trim_trailing_whitespace = false
max_line_length =

[src/parser/__tests__/patches/*.gitpatch]
end_of_line =

[src/parser/__tests__/**/*.txt]
max_line_length =

[src/repository/parser/__tests__/mercurial/*.txt]
trim_trailing_whitespace = false
insert_final_newline = false
max_line_length =

[src/unit/parser/__tests__/testresults/go.*]
indent_style =

[src/unit/parser/__tests__/testresults/xunit.*]
max_line_length =

[externals/**]
; Use editor default (possible autodetection).
indent_style =
indent_size =
trim_trailing_whitespace = false
Expand Down
1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down
6 changes: 5 additions & 1 deletion scripts/breakout.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ def main(stdscr):
h = height / 10
for x in range(1, width / 7 - 1):
for y in range(1, 7):
entities.append(Block(x * 7, y * h + x / 2 % 2, 7, h, colors[y - 1]))
entities.append(Block(x * 7,
y * h + x / 2 % 2,
7,
h,
colors[y - 1]))

while True:
while select.select([ sys.stdin ], [], [], 0)[0]:
Expand Down
2 changes: 1 addition & 1 deletion src/lint/linter/__tests__/gjslint/gjslint.lint-test
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ error:2:
error:4:
error:5:
error:7:
error:9:
error:9:
2 changes: 1 addition & 1 deletion src/lint/linter/__tests__/jshint/jshint.lint-test
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ function f() {

~~~~~~~~~~
warning:3:8
error:7:1
error:7:1
2 changes: 1 addition & 1 deletion src/lint/linter/__tests__/lessc/css.lint-test
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ p + h1 {
background: -webkit-gradient(linear, left top, left bottom, from(red), to(blue));
margin: ;
.nested-multiple {
multiple-semi-colons: yes;;;;;;
multiple-semi-colons: yes;;;;;;
};
filter: alpha(opacity=100);
width: auto\9;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// simple array/list:

.multiunit {
Expand Down
6 changes: 3 additions & 3 deletions src/lint/linter/__tests__/lessc/functions.lint-test
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@
format-single-quoted: %('hello %s', "single world");
format-escaped-string: %(~"hello %s", "escaped world");
eformat: e(%("rgb(%d, %d, %d)", @r, 128, 64));

unitless: unit(12px);
unit: unit((13px + 1px), em);
unitpercentage: unit(100, %);

get-unit: get-unit(10px);
get-unit-empty: get-unit(10);

Expand Down Expand Up @@ -118,7 +118,7 @@

fade-out: fadeOut(red, 5%); // support fadeOut and fadeout
fade-in: fadein(fadeout(red, 10%), 5%);

hsv: hsv(5, 50%, 30%);
hsva: hsva(3, 50%, 30%, 0.2);

Expand Down
1 change: 0 additions & 1 deletion src/lint/linter/__tests__/lessc/media.lint-test
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// For now, variables can't be declared inside @media blocks.

@var: 42;
Expand Down
8 changes: 4 additions & 4 deletions src/lint/linter/__tests__/lessc/selectors.lint-test
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ a {
.qux & {
display: inline;
}
.qux& {
display: inline-block;
}
.qux& {
display: inline-block;
}
.qux & .biz {
display: none;
}
Expand Down Expand Up @@ -123,7 +123,7 @@ a {
}
@num: 3;
:nth-child(@{num}) {
selector: interpolated;
selector: interpolated;
}
.test {
&:nth-child(odd):not(:nth-child(3)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
deprecated_function();
modern_function();
~~~~~~~~~~
warning:3:1
warning:3:1
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ final class C { }
*/
class D { }
~~~~~~~~~~
warning:3:7
warning:3:7
2 changes: 1 addition & 1 deletion src/lint/linter/__tests__/phpcs/basics.lint-test
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ error:2:1
error:3:1
error:3:14
error:4:3
error:6:3
error:6:3
4 changes: 2 additions & 2 deletions src/lint/linter/__tests__/text/dos-newline.lint-test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The quick brown fox
jumps over the lazy dog.
The quick brown fox
jumps over the lazy dog.
~~~~~~~~~~
error:1:1
~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion src/lint/linter/__tests__/xhpast/embedded-tags.lint-test
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

This shouldn't fatal the parser.
~~~~~~~~~~
error:1:10
error:1:10
2 changes: 1 addition & 1 deletion src/lint/linter/__tests__/xhpast/exit-expression.lint-test
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ strtoupper(33 * exit - 6);
~~~~~~~~~~
error:3:1
warning:3:6
error:4:17
error:4:17
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ final class Platypus {
}
~~~~~~~~~~
error:2:13 XHP19 Class-Filename Mismatch
error:3:19
error:3:19
7 changes: 6 additions & 1 deletion src/lint/linter/__tests__/xhpast/windows.lint-test
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ chroot('/tmp');
error:3:1
~~~~~~~~~~
~~~~~~~~~~
{"config": {"xhpast.php-version": "5.2.3", "xhpast.php-version.windows": "5.3.0"}}
{
"config": {
"xhpast.php-version": "5.2.3",
"xhpast.php-version.windows": "5.3.0"
}
}
26 changes: 13 additions & 13 deletions src/parser/__tests__/diff/more-newlines.svndiff
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Index: Database/tables/dbo.Account.sql
===================================================================
--- Database/tables/dbo.Account.sql (revision 1587)
+++ Database/tables/dbo.Account.sql (working copy)
@@ -23,6 +23,8 @@
GO
CREATE CLUSTERED INDEX IX_Account ON [Account] ([CreationDateTime])
GO
+ALTER TABLE [dbo].[Account] ADD CONSTRAINT [UK_Account_APIKey] UNIQUE ([APIKey])
+GO
ALTER TABLE [dbo].[Account] ADD CONSTRAINT [DF_Account_AccountId] DEFAULT (newid()) FOR [AccountId]
GO
ALTER TABLE [dbo].[Account] ADD CONSTRAINT [DF_Account_CreationDateTime] DEFAULT (getutcdate()) FOR [CreationDateTime]
Index: Database/tables/dbo.Account.sql
===================================================================
--- Database/tables/dbo.Account.sql (revision 1587)
+++ Database/tables/dbo.Account.sql (working copy)
@@ -23,6 +23,8 @@
GO
CREATE CLUSTERED INDEX IX_Account ON [Account] ([CreationDateTime])
GO
+ALTER TABLE [dbo].[Account] ADD CONSTRAINT [UK_Account_APIKey] UNIQUE ([APIKey])
+GO
ALTER TABLE [dbo].[Account] ADD CONSTRAINT [DF_Account_AccountId] DEFAULT (newid()) FOR [AccountId]
GO
ALTER TABLE [dbo].[Account] ADD CONSTRAINT [DF_Account_CreationDateTime] DEFAULT (getutcdate()) FOR [CreationDateTime]
20 changes: 10 additions & 10 deletions src/parser/__tests__/diff/svn-property-windows.svndiff
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Index: .arcconfig
===================================================================
--- .arcconfig (revision 1957)
+++ .arcconfig (working copy)
Property changes on: .arcconfig
___________________________________________________________________
Added: herp
## -0,0 +1 ##
+derp
Index: .arcconfig
===================================================================
--- .arcconfig (revision 1957)
+++ .arcconfig (working copy)

Property changes on: .arcconfig
___________________________________________________________________
Added: herp
## -0,0 +1 ##
+derp
\ No newline at end of property
2 changes: 1 addition & 1 deletion src/unit/parser/__tests__/testresults/xunit.no-tests
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?xml version="1.0" encoding="utf-8"?><testsuite name="" errors="0" failures="0" skips="0" tests="0" time="0.001" ></testsuite>
<?xml version="1.0" encoding="utf-8"?><testsuite name="" errors="0" failures="0" skips="0" tests="0" time="0.001" ></testsuite>

0 comments on commit f2a3fdf

Please sign in to comment.