Skip to content

Commit cdba4cf

Browse files
committed
Run perltidy and prettier on all files in the renderer codebase.
1 parent 5cc1807 commit cdba4cf

32 files changed

+1754
-1650
lines changed

.github/workflows/createContainer.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@ name: Github Packages Release
33
on:
44
push:
55
branches:
6-
- main
7-
- development
6+
- main
7+
- development
88
tags:
9-
- v*
9+
- v*
1010

1111
jobs:
1212
build:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
16+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
1717
- uses: actions/checkout@v2
1818
with:
1919
submodules: recursive
20-
20+
2121
- name: Extract branch/tag name
2222
shell: bash
2323
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
2424
id: extract_branch
25-
25+
2626
# make sure you have "Improved Container Support" enabled for both your personal and/or Organization accounts!
2727
- uses: pmorelli92/github-container-registry-build-push@2.0.0
2828
name: Build and Publish latest service image

LICENSE.md

Lines changed: 164 additions & 164 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 94 additions & 78 deletions
Large diffs are not rendered by default.

docs/make_translation_files.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ xgettext.pl -o WeBWorK/Localize/standalone.pot -D PG/lib -D PG/macros -D RenderA
1515
cd WeBWorK/Localize
1616
find . -name '*.po' -exec bash -c "echo \"Updating {}\"; msgmerge -qUN {} standalone.pot" \;
1717
```
18-

k8/Ingress.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ spec:
1212
name: letsencrypt-prod-private-key
1313
# Add a single challenge solver, HTTP01 using nginx
1414
solvers:
15-
- http01:
16-
ingress:
17-
class: nginx
15+
- http01:
16+
ingress:
17+
class: nginx
1818
---
1919
apiVersion: networking.k8s.io/v1
2020
kind: Ingress
@@ -25,17 +25,17 @@ metadata:
2525
cert-manager.io/cluster-issuer: letsencrypt-prod
2626
spec:
2727
tls:
28-
- hosts:
29-
- "example.org"
30-
secretName: renderer-kubernetes-tls
28+
- hosts:
29+
- 'example.org'
30+
secretName: renderer-kubernetes-tls
3131
rules:
32-
- host: "example.org"
33-
http:
34-
paths:
35-
- pathType: Prefix
36-
path: "/"
37-
backend:
38-
service:
39-
name: wwrenderer
40-
port:
41-
number: 80
32+
- host: 'example.org'
33+
http:
34+
paths:
35+
- pathType: Prefix
36+
path: '/'
37+
backend:
38+
service:
39+
name: wwrenderer
40+
port:
41+
number: 80

k8/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#Deploy Renderer to Kubernetes
2+
23
1. Install `kubectl`, the [official Kubernetes client](https://kubernetes.io/docs/tasks/tools/install-kubectl/). Use the most recent version of kubectl to ensure you are within one minor version of your cluster's Kubernetes version.
34
2. Install `doctl`, the official [DigitalOcean command-line tool](https://github.com/digitalocean/doctl), or other cloud platform-specific command-line tool.
45
3. Install [helm](https://helm.sh/docs/intro/install/), the kubernetes package manager.

lib/RenderApp.pm

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -87,31 +87,31 @@ sub startup {
8787

8888
# Add Cache-Control and Expires headers to static content from webwork2_files
8989
if (my $STATIC_EXPIRES = $self->config('STATIC_EXPIRES')) {
90-
$STATIC_EXPIRES = int( $STATIC_EXPIRES );
91-
my $cache_control_setting = "max-age=$STATIC_EXPIRES";
92-
my $no_cache_setting = 'max-age=1, no-cache';
93-
$self->hook(after_dispatch => sub {
94-
my $c = shift;
95-
96-
# Only process if file requested is under webwork2_files
97-
return unless ($c->req->url->path =~ '^/webwork2_files/');
98-
99-
if ($c->req->url->path =~ '/tmp/renderer') {
100-
# Treat problem generated files as already expired.
101-
# They should not be cached.
102-
$c->res->headers->cache_control( $no_cache_setting );
103-
$c->res->headers->header(Expires =>
104-
Mojo::Date->new(time - 86400) # expired 24 hours ago
105-
);
106-
} else {
107-
# Standard "static" files.
108-
# They can be cached
109-
$c->res->headers->cache_control( $cache_control_setting );
110-
$c->res->headers->header(Expires =>
111-
Mojo::Date->new(time + $STATIC_EXPIRES)
112-
);
113-
}
114-
});
90+
$STATIC_EXPIRES = int($STATIC_EXPIRES);
91+
my $cache_control_setting = "max-age=$STATIC_EXPIRES";
92+
my $no_cache_setting = 'max-age=1, no-cache';
93+
$self->hook(
94+
after_dispatch => sub {
95+
my $c = shift;
96+
97+
# Only process if file requested is under webwork2_files
98+
return unless ($c->req->url->path =~ '^/webwork2_files/');
99+
100+
if ($c->req->url->path =~ '/tmp/renderer') {
101+
# Treat problem generated files as already expired.
102+
# They should not be cached.
103+
$c->res->headers->cache_control($no_cache_setting);
104+
$c->res->headers->header(
105+
Expires => Mojo::Date->new(time - 86400) # expired 24 hours ago
106+
);
107+
} else {
108+
# Standard "static" files.
109+
# They can be cached
110+
$c->res->headers->cache_control($cache_control_setting);
111+
$c->res->headers->header(Expires => Mojo::Date->new(time + $STATIC_EXPIRES));
112+
}
113+
}
114+
);
115115
}
116116

117117
# Models

lib/RenderApp/Controller/IO.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package RenderApp::Controller::IO;
22
use Mojo::Base -async_await;
33
use Mojo::Base 'Mojolicious::Controller';
44
use File::Spec::Functions qw(splitdir);
5-
use File::Find qw(find);
6-
use MIME::Base64 qw(decode_base64);
7-
use Mojo::JSON qw(decode_json);
5+
use File::Find qw(find);
6+
use MIME::Base64 qw(decode_base64);
7+
use Mojo::JSON qw(decode_json);
88
use Mojolicious::Validator;
99
use Math::Random::Secure qw( rand );
1010
use Mojo::IOLoop;

lib/RenderApp/Controller/Pages.pm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ package RenderApp::Controller::Pages;
22
use Mojo::Base 'Mojolicious::Controller';
33

44
sub twocolumn {
5-
my $c = shift;
6-
$c->render(template=>'pages/twocolumn');
5+
my $c = shift;
6+
$c->render(template => 'pages/twocolumn');
77
}
88

99
sub oplUI {
10-
my $c = shift;
11-
$c->render(template=>'pages/oplUI');
10+
my $c = shift;
11+
$c->render(template => 'pages/oplUI');
1212
}
1313

14-
1;
14+
1;

lib/RenderApp/Controller/Render.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package RenderApp::Controller::Render;
22
use Mojo::Base 'Mojolicious::Controller', -async_await;
33

4-
use Mojo::JSON qw(encode_json decode_json);
5-
use Crypt::JWT qw(encode_jwt decode_jwt);
4+
use Mojo::JSON qw(encode_json decode_json);
5+
use Crypt::JWT qw(encode_jwt decode_jwt);
66
use Time::HiRes qw/time/;
77

88
use WeBWorK::PreTeXt;

0 commit comments

Comments
 (0)