Skip to content

Commit 3b42106

Browse files
committed
a bunch of cleanup.
1 parent 055629b commit 3b42106

32 files changed

+50
-67
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ module.exports = {
4747
process: 'readonly'
4848
},
4949
rules: baseRules,
50+
5051
overrides: [{
5152
files: ['*.ts', '*.tsx', '*.vue'],
5253

.github/workflows/linter.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ jobs:
5656
# Run Linter against code base #
5757
################################
5858
- name: Super-Linter
59-
# Note that this actually uses super-linter version 4.6.0 which is the desired version.
60-
# See https://github.com/github/super-linter/issues/1839.
61-
# It seems that version 4.6.1 has a bug with perlcritic, so we actually want 4.6.0.
62-
# updated to 4.8.1 If this works, I'll edit the above lines.
6359
uses: github/[email protected]
6460

6561
env:

.github/workflows/unit-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ jobs:
3232
env:
3333
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3434
run: cover -report codecov
35-
# Install node (for npm) and use it to install eslint and stylelint dependencies.
35+
36+
# Install node (for npm) and use it to install eslint and stylelint dependencies.
3637
- name: Use Node.js
3738
uses: actions/setup-node@v2
3839
with:

conf/ww3-dev.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
secrets:
3+
- 3cdf63327fcf77deaed1d200df4b9fee66af2326
4+
webwork3_home: /opt/webwork/webwork3
5+
6+
# Database settings
7+
8+
# These settings are used for running unit_tests. You should choose a database
9+
# that is separate from any either production or other testing database. The
10+
# sqlite one is recommended. If you choose another full-featured DB, select a
11+
# database that is different than others.
12+
13+
# For the sqlite database
14+
test_database_dsn: dbi:SQLite:/opt/webwork/webwork3/t/db/sample_db.sqlite
15+
# For mysql or mariadb
16+
# note: choose a database
17+
#test_database_dsn: dbi:mysql:dbname=webwork3_test
18+
19+
# Database credentials for mysql or mariadb.
20+
# These are ignored if the 'sqlite' database is used.
21+
test_database_user: webworkWrite
22+
test_database_password: password
23+
24+
# If ignore_permissions is set to true, all routes can be executed.
25+
# This should only be used in development.
26+
ignore_permissions: true
27+
28+

jest.config.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
11
/* eslint-disable no-undef */
22

33
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
4-
const { pathsToModuleNameMapper } = require('ts-jest/utils')
4+
const { pathsToModuleNameMapper } = require('ts-jest/utils');
55
// In the following statement, replace `./tsconfig` with the path to your `tsconfig` file
66
// which contains the path mapping (ie the `compilerOptions.paths` option):
77

8-
const { compilerOptions } = require('./tsconfig')
9-
10-
8+
const { compilerOptions } = require('./tsconfig');
119

1210
module.exports = {
1311
preset: 'ts-jest',
1412
testEnvironment: 'node',
1513
globals: {
16-
"ts-jest": {
17-
"tsconfig": "tsconfig.json",
18-
"diagnostics": true
14+
'ts-jest': {
15+
'tsconfig': 'tsconfig.json',
16+
'diagnostics': true
1917
}
2018
},
2119
// A map from regular expressions to module names that allow to stub out resources with a single module
2220
// moduleNameMapper: {
2321
// '^@/(.*)$': '<rootDir>/src/$1',
2422
// },
25-
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths , { prefix: '<rootDir>/' } ),
26-
testRegex: "(/tests/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
23+
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' }),
24+
testRegex: '(/tests/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
2725
};

lib/DB/Schema/Result/ProblemSet.pm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,17 @@ __PACKAGE__->add_columns(
100100
default_value => 1,
101101
is_nullable => 0
102102
},
103-
set_dates => { # store dates as a JSON object
103+
# store dates as a JSON object
104+
set_dates => {
104105
data_type => 'text',
105106
size => 256,
106107
is_nullable => 0,
107108
default_value => '{}',
108109
serializer_class => 'JSON',
109110
serializer_options => { utf8 => 1 }
110111
},
111-
set_params => { # store params as a JSON object
112+
# store params as a JSON object
113+
set_params => {
112114
data_type => 'text',
113115
size => 256,
114116
is_nullable => 0,

lib/DB/Schema/ResultSet/Problem.pm

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ use strict;
33
use warnings;
44
use base 'DBIx::Class::ResultSet';
55

6-
use Carp;
7-
use Data::Dumper;
8-
96
# use List::Util qw/first/;
107

118
use DB::Utils qw/getCourseInfo getSetInfo getProblemInfo/;

lib/DB/Schema/ResultSet/ProblemPool.pm

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ use strict;
33
use warnings;
44
use base 'DBIx::Class::ResultSet';
55

6-
use Carp;
7-
use Data::Dumper;
8-
use Scalar::Util qw/reftype/;
96
use Try::Tiny;
107

118
use DB::Utils qw/getCourseInfo getPoolInfo getPoolProblemInfo/;

lib/DB/Schema/ResultSet/ProblemSet.pm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use base 'DBIx::Class::ResultSet';
55

66
use Carp;
77
use Clone qw/clone/;
8-
use Data::Dumper;
98

109
use DB::Utils qw/getCourseInfo getUserInfo getSetInfo updateAllFields/;
1110

lib/DB/Schema/ResultSet/User.pm

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use strict;
1111
use warnings;
1212
use base 'DBIx::Class::ResultSet';
1313

14-
use Data::Dumper;
1514
use Array::Utils qw/array_minus/;
1615
use Clone qw/clone/;
1716

@@ -367,8 +366,7 @@ The method returns only the information in the course_user table
367366

368367
sub addCourseUser {
369368
my ($self, $course_user_params, $as_result_set) = @_;
370-
# warn "in addCourseUser";
371-
# warn Dumper $course_user_params;
369+
372370
my $course = $self->result_source->schema->resultset("Course")->getCourse(getCourseInfo($course_user_params), 1);
373371
my $user = $self->getGlobalUser(getUserInfo($course_user_params), 1);
374372

0 commit comments

Comments
 (0)