Skip to content

Commit 0f65419

Browse files
authored
Merge pull request #9 from IBMStreams/develop
Warn user if a makefile from their application directory will be used to build
2 parents d8f39fe + e93c576 commit 0f65419

File tree

6 files changed

+209
-191
lines changed

6 files changed

+209
-191
lines changed

.editorconfig

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
# editorconfig.org
2-
3-
root = true
4-
5-
[*]
6-
charset = utf-8
7-
indent_style = tab
8-
indent_size = 2
9-
insert_final_newline = true
10-
trim_trailing_whitespace = true
11-
end_of_line = lf
12-
13-
[*.md]
14-
trim_trailing_whitespace = false
15-
indent_style = space
16-
17-
[{*.json,*.yml}]
18-
indent_style = space
19-
indent_size = 2
1+
# editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
indent_style = tab
8+
indent_size = 2
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
end_of_line = lf
12+
13+
[*.md]
14+
trim_trailing_whitespace = false
15+
indent_style = space
16+
17+
[{*.json,*.yml}]
18+
indent_style = space
19+
indent_size = 2

.eslintrc.js

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
1-
module.exports = {
2-
parser: "babel-eslint",
3-
plugins: [
4-
"babel",
5-
"flowtype"
6-
],
7-
extends: [
8-
"plugin:flowtype/recommended"
9-
],
10-
rules: {
11-
// Disable strict warning on ES6 Components
12-
"strict": 0,
13-
"global-require": 0,
14-
"sort-imports": 0,
15-
//"react/jsx-indent-props": [2, "tab"],
16-
17-
// Allow class level arrow functions
18-
"no-invalid-this": 0,
19-
"babel/no-invalid-this": 1,
20-
21-
// Allow flow type annotations on top
22-
// "react/sort-comp": [1, {
23-
// order: [
24-
// "type-annotations",
25-
// "static-methods",
26-
// "lifecycle",
27-
// "everything-else",
28-
// "render",
29-
// ],
30-
// }],
31-
32-
// Allow underscore in property names
33-
"camelcase": ["off"],
34-
35-
// Intent rules
36-
"indent": ["error", "tab", {
37-
"SwitchCase": 1,
38-
"CallExpression": {
39-
"arguments": "off",
40-
},
41-
}],
42-
}
43-
};
1+
module.exports = {
2+
parser: "babel-eslint",
3+
plugins: [
4+
"babel",
5+
"flowtype"
6+
],
7+
extends: [
8+
"plugin:flowtype/recommended"
9+
],
10+
rules: {
11+
// Disable strict warning on ES6 Components
12+
"strict": 0,
13+
"global-require": 0,
14+
"sort-imports": 0,
15+
//"react/jsx-indent-props": [2, "tab"],
16+
17+
// Allow class level arrow functions
18+
"no-invalid-this": 0,
19+
"babel/no-invalid-this": 1,
20+
21+
// Allow flow type annotations on top
22+
// "react/sort-comp": [1, {
23+
// order: [
24+
// "type-annotations",
25+
// "static-methods",
26+
// "lifecycle",
27+
// "everything-else",
28+
// "render",
29+
// ],
30+
// }],
31+
32+
// Allow underscore in property names
33+
"camelcase": ["off"],
34+
35+
// Intent rules
36+
"indent": ["error", "tab", {
37+
"SwitchCase": 1,
38+
"CallExpression": {
39+
"arguments": "off",
40+
},
41+
}],
42+
}
43+
};

lib/LintHandler.js

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// @flow
2-
"use strict";
3-
"use babel";
4-
1+
// @flow
2+
"use strict";
3+
"use babel";
4+
55
export class LintHandler {
66

77
linter = null;
@@ -15,58 +15,58 @@ export class LintHandler {
1515
}
1616

1717

18-
lint(input) {
19-
if (!this.linter || !input) {
20-
return;
21-
}
22-
23-
if (input.output && Array.isArray(input.output)) {
24-
let convertedMessages = input.output.map(
25-
(message) => message.message_text
26-
).filter(
27-
// filter only messages that match expected format
28-
(msg) => msg.match(this.msgRegex)
29-
).map(
30-
(msg) => {
31-
// return objects for each message
32-
let parts = msg.match(this.msgRegex);
33-
let severityCode = parts[4].trim().substr(parts[4].trim().length - 1);
34-
let severity = "info";
35-
if (severityCode) {
36-
switch (severityCode) {
37-
case "I":
38-
severity = "info";
39-
break;
40-
case "W":
41-
severity = "warning";
42-
break;
43-
case "E":
44-
severity = "error";
45-
break;
46-
default:
47-
break;
48-
}
49-
}
50-
let absolutePath = parts[1];
51-
if (this.appRoot && typeof(this.appRoot) === "string") {
52-
absolutePath = `${this.appRoot}/${parts[1]}`;
53-
}
54-
55-
return {
56-
severity: severity,
57-
location: {
58-
59-
file: absolutePath,
60-
position: [[parts[2]-1,parts[3]-1],[parts[2]-1,parts[3]]], // 0-indexed
61-
},
62-
excerpt: parts[4],
63-
description: parts[5],
64-
};
65-
}
66-
);
67-
68-
this.linter.setAllMessages(convertedMessages);
69-
70-
}
71-
}
18+
lint(input) {
19+
if (!this.linter || !input) {
20+
return;
21+
}
22+
23+
if (input.output && Array.isArray(input.output)) {
24+
let convertedMessages = input.output.map(
25+
(message) => message.message_text
26+
).filter(
27+
// filter only messages that match expected format
28+
(msg) => msg.match(this.msgRegex)
29+
).map(
30+
(msg) => {
31+
// return objects for each message
32+
let parts = msg.match(this.msgRegex);
33+
let severityCode = parts[4].trim().substr(parts[4].trim().length - 1);
34+
let severity = "info";
35+
if (severityCode) {
36+
switch (severityCode) {
37+
case "I":
38+
severity = "info";
39+
break;
40+
case "W":
41+
severity = "warning";
42+
break;
43+
case "E":
44+
severity = "error";
45+
break;
46+
default:
47+
break;
48+
}
49+
}
50+
let absolutePath = parts[1];
51+
if (this.appRoot && typeof(this.appRoot) === "string") {
52+
absolutePath = `${this.appRoot}/${parts[1]}`;
53+
}
54+
55+
return {
56+
severity: severity,
57+
location: {
58+
59+
file: absolutePath,
60+
position: [[parts[2]-1,parts[3]-1],[parts[2]-1,parts[3]]], // 0-indexed
61+
},
62+
excerpt: parts[4],
63+
description: parts[5],
64+
};
65+
}
66+
);
67+
68+
this.linter.setAllMessages(convertedMessages);
69+
70+
}
71+
}
7272
}

0 commit comments

Comments
 (0)