Skip to content

Commit 1fe711a

Browse files
authored
Merge pull request #30 from eightants/eightants-patch-1
Adding lint and prettier actions
2 parents bf850c2 + 7256f8b commit 1fe711a

File tree

4 files changed

+171
-147
lines changed

4 files changed

+171
-147
lines changed
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# This is a basic workflow to help you get started with Actions
22

3-
name: CI
3+
name: Run Prettier
44

55
# Controls when the action will run. Triggers the workflow on push or pull request
66
# events but only for the master branch
77
on:
8-
push:
9-
branches: [ master ]
108
pull_request:
119
branches: [ master ]
1210

@@ -21,11 +19,12 @@ jobs:
2119
steps:
2220
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2321
- uses: actions/checkout@v2
24-
25-
- name: Lint Action
26-
uses: wearerequired/lint-action@v1.6.0
22+
with:
23+
ref: ${{ github.head_ref }}
24+
fetch-depth: 0
2725

2826
- name: Prettier Action
2927
uses: creyD/prettier_action@v3.1
30-
31-
28+
with:
29+
only_changed: True
30+
same_commit: True

application/karma.conf.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,30 @@
33

44
module.exports = function (config) {
55
config.set({
6-
basePath: '',
7-
frameworks: ['jasmine', '@angular-devkit/build-angular'],
6+
basePath: "",
7+
frameworks: ["jasmine", "@angular-devkit/build-angular"],
88
plugins: [
9-
require('karma-jasmine'),
10-
require('karma-chrome-launcher'),
11-
require('karma-jasmine-html-reporter'),
12-
require('karma-coverage-istanbul-reporter'),
13-
require('@angular-devkit/build-angular/plugins/karma')
9+
require("karma-jasmine"),
10+
require("karma-chrome-launcher"),
11+
require("karma-jasmine-html-reporter"),
12+
require("karma-coverage-istanbul-reporter"),
13+
require("@angular-devkit/build-angular/plugins/karma"),
1414
],
1515
client: {
16-
clearContext: false // leave Jasmine Spec Runner output visible in browser
16+
clearContext: false, // leave Jasmine Spec Runner output visible in browser
1717
},
1818
coverageIstanbulReporter: {
19-
dir: require('path').join(__dirname, './coverage/application'),
20-
reports: ['html', 'lcovonly', 'text-summary'],
21-
fixWebpackSourcePaths: true
19+
dir: require("path").join(__dirname, "./coverage/application"),
20+
reports: ["html", "lcovonly", "text-summary"],
21+
fixWebpackSourcePaths: true,
2222
},
23-
reporters: ['progress', 'kjhtml'],
23+
reporters: ["progress", "kjhtml"],
2424
port: 9876,
2525
colors: true,
2626
logLevel: config.LOG_INFO,
2727
autoWatch: true,
28-
browsers: ['Chrome'],
28+
browsers: ["Chrome"],
2929
singleRun: false,
30-
restartOnFileChange: true
30+
restartOnFileChange: true,
3131
});
3232
};

server/mock-server.js

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,21 @@ app.use(cors()).use(cookieParser());
3131
* Please fill this in for the mock-server to function correctly.
3232
*/
3333
// TODO: YOUR APP CLIENT ID AND SECRET HERE
34-
var client_id = "id";
34+
var client_id = "id";
3535
var client_secret = "secret";
3636
// TODO: Your redirect uri as entered in your Spotify app
3737
var redirect_uri = "http://localhost:8888/callback/";
3838
var basePath = "http://localhost:4200"; // For the frontend, this is the default port for Angular
3939

40-
4140
/**
4241
* Generates a random string containing numbers and letters
4342
* @param {number} length The length of the string
4443
* @return {string} The generated string
4544
*/
46-
var generateRandomString = function(length) {
47-
var text = '';
48-
var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
45+
var generateRandomString = function (length) {
46+
var text = "";
47+
var possible =
48+
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
4949

5050
for (var i = 0; i < length; i++) {
5151
text += possible.charAt(Math.floor(Math.random() * possible.length));
@@ -229,7 +229,7 @@ app.post("/postchallengescore", function (req, res) {
229229
});
230230

231231
app.get("/cleanchallenges", function (req, res) {
232-
return res.json({status: "success"});
232+
return res.json({ status: "success" });
233233
});
234234

235235
app.get("/api/user/:user", function (req, res) {
@@ -243,7 +243,7 @@ app.get("/api/user/:user", function (req, res) {
243243
instrumentalness: 0.5,
244244
tempo: 125,
245245
loudness: 0.5,
246-
})
246+
});
247247
});
248248

249249
app.get("/api/features/user/:user", cors(), function (req, res) {
@@ -257,21 +257,23 @@ app.get("/api/features/user/:user", cors(), function (req, res) {
257257
instrumentalness: 0.5,
258258
tempo: 125,
259259
loudness: 0.5,
260-
})
260+
});
261261
});
262262

263263
app.get("/api/features/group/:category", cors(), function (req, res) {
264-
return res.json([{
265-
acousticness: 0.5,
266-
danceability: 0.2,
267-
energy: 0.2,
268-
valence: 0.2,
269-
liveness: 0.5,
270-
speechiness: 0.3,
271-
instrumentalness: 0.3,
272-
tempo: 125,
273-
loudness: 0.5,
274-
}])
264+
return res.json([
265+
{
266+
acousticness: 0.5,
267+
danceability: 0.2,
268+
energy: 0.2,
269+
valence: 0.2,
270+
liveness: 0.5,
271+
speechiness: 0.3,
272+
instrumentalness: 0.3,
273+
tempo: 125,
274+
loudness: 0.5,
275+
},
276+
]);
275277
});
276278

277279
app.post("/api/postanalysis", function (req, res) {

0 commit comments

Comments
 (0)