Issue #51: Add linter to .gitlabci.yml

Signed-off-by: Lucas Fernandes de Oliveira's avatarLucas Fernandes de Oliveira <lfo14@inf.ufpr.br>
parent d034968b
Pipeline #13698 passed with stage
in 52 seconds
...@@ -19,6 +19,7 @@ run_tests: ...@@ -19,6 +19,7 @@ run_tests:
script: script:
- mv config/ci_test.yaml.example config/test.yaml - mv config/ci_test.yaml.example config/test.yaml
- npm test - npm test
- npm run lint
tags: tags:
- node - node
- postgres - postgres
...@@ -646,7 +646,7 @@ export class PostgresAdapter extends Adapter { ...@@ -646,7 +646,7 @@ export class PostgresAdapter extends Adapter {
// Joins // Joins
let conds: string[] = []; let conds: string[] = [];
for (let i in dimMap) { for (let i of Object.keys(dimMap)) {
let remainViews = dimMap[i].views.slice(); let remainViews = dimMap[i].views.slice();
let dim = dimMap[i].dim; let dim = dimMap[i].dim;
let leftSide = this.buildColumn(dim, remainViews.shift().id); let leftSide = this.buildColumn(dim, remainViews.shift().id);
......
...@@ -311,7 +311,7 @@ describe("engine class", () => { ...@@ -311,7 +311,7 @@ describe("engine class", () => {
"==": FilterOperator.EQUAL, "==": FilterOperator.EQUAL,
"!=": FilterOperator.NOTEQUAL "!=": FilterOperator.NOTEQUAL
}; };
for (let op in operators) { for (let op of Object.keys(operators)) {
const strFilter = "dim:0" + op + "0"; const strFilter = "dim:0" + op + "0";
const clause = engine.parseClause(strFilter); const clause = engine.parseClause(strFilter);
expect(clause).to.be.an("object"); expect(clause).to.be.an("object");
...@@ -328,7 +328,7 @@ describe("engine class", () => { ...@@ -328,7 +328,7 @@ describe("engine class", () => {
expect(clause.filters[0].operator).to.be.equal(operators[op]); expect(clause.filters[0].operator).to.be.equal(operators[op]);
} }
for (let op in operators) { for (let op of Object.keys(operators)) {
const strFilter = "dim:2" + op + "0"; const strFilter = "dim:2" + op + "0";
const clause = engine.parseClause(strFilter); const clause = engine.parseClause(strFilter);
expect(clause).to.be.an("object"); expect(clause).to.be.an("object");
......
...@@ -339,7 +339,7 @@ export class Graph { ...@@ -339,7 +339,7 @@ export class Graph {
let queue: Vertex[] = [root]; let queue: Vertex[] = [root];
while (queue.length > 0) { while (queue.length > 0) {
let v: Vertex = queue.shift(); let v: Vertex = queue.shift();
for (let key in v.neighbors) { for (let key of Object.keys(v.neighbors)) {
let u: Vertex = this.verticeMap[key]; let u: Vertex = this.verticeMap[key];
if (this.canVisit(u, v.neighbors[key], clauses)) { if (this.canVisit(u, v.neighbors[key], clauses)) {
// Mark all vertices visited by the search // Mark all vertices visited by the search
...@@ -414,7 +414,7 @@ export class Graph { ...@@ -414,7 +414,7 @@ export class Graph {
let views: View[] = []; let views: View[] = [];
// Pick all views that contain the root vertex // Pick all views that contain the root vertex
for (let i in root.neighbors) { for (let i of Object.keys(root.neighbors)) {
views = views.concat(root.neighbors[i].filter((item) => { views = views.concat(root.neighbors[i].filter((item) => {
return item.isView && return item.isView &&
this.passConstraints(clauses, item.view.clauses); this.passConstraints(clauses, item.view.clauses);
......
...@@ -138,7 +138,7 @@ export class Fixture { ...@@ -138,7 +138,7 @@ export class Fixture {
for (let i = 0; i < rows.length; ++i) { for (let i = 0; i < rows.length; ++i) {
let values = []; let values = [];
let keys = []; let keys = [];
for (let key in rows[i]) { for (let key of Object.keys(rows[i])) {
keys.push("\"" + key + "\""); keys.push("\"" + key + "\"");
values.push("'" + rows[i][key] + "'"); values.push("'" + rows[i][key] + "'");
} }
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
"object-literal-sort-keys": false, "object-literal-sort-keys": false,
"one-line": false, "one-line": false,
"trailing-comma": false, "trailing-comma": false,
"interface-name": false "interface-name": false,
"max-line-length": false,
"member-ordering": false
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment