Add linting, pass gentle level

This commit is contained in:
Rumperuu 2021-03-20 11:52:59 +00:00
parent a8248f654f
commit 602a59f1c3
10 changed files with 17 additions and 9 deletions

View file

@ -32,13 +32,17 @@ This repository contains the server application for the LocalSpend system. See a
The server app. is written in [Perl](https://www.perl.org/). The server app. is written in [Perl](https://www.perl.org/).
Admin. portal pages are templated using [HTML::EP](https://metacpan.org/pod/distribution/HTML-EP/lib/HTML/EP.pod).
| Technology | Description | Link | | Technology | Description | Link |
|-------------|--------------------------------------|---------------------| |-------------|--------------------------------------|---------------------|
| Mojolicious | Perl Web framework | [Link][mojolicious] | | Mojolicious | Perl Web framework | [Link][mojolicious] |
| PostgreSQL | Relational database managment system | [Link][postgresql] | | PostgreSQL | Relational database managment system | [Link][postgresql] |
| SQLite | Relational database managment system | [Link][sqlite] |
[mojolicious]: https://mojolicious.org/ [mojolicious]: https://mojolicious.org/
[postgresql]: https://www.postgresql.org/ [postgresql]: https://www.postgresql.org/
[sqlite]: https://sqlite.org/index.html
## Features ## Features
@ -122,7 +126,7 @@ Test files are found in the `t/` directory.
## Code Formatting ## Code Formatting
TODO Run `perlcritic lib/` to format all Perl files with [Perl::Critic](https://metacpan.org/pod/Perl::Critic).
## Documentation ## Documentation

View file

@ -28,6 +28,7 @@ requires 'Text::CSV';
requires 'Try::Tiny'; requires 'Try::Tiny';
requires 'Throwable::Error'; requires 'Throwable::Error';
requires 'Minion'; requires 'Minion';
requires 'Perl::Critic';
requires 'WWW::FCM::HTTP'; requires 'WWW::FCM::HTTP';
on 'test' => sub { on 'test' => sub {

View file

@ -73,7 +73,7 @@ sub pg_or_sqlite {
return \$sqlite_sql; return \$sqlite_sql;
} else { } else {
$c->app->log->warn('Unknown Driver Used'); $c->app->log->warn('Unknown Driver Used');
return undef; return;
} }
} }

View file

@ -113,7 +113,7 @@ sub pg_or_sqlite {
return \$sqlite_sql; return \$sqlite_sql;
} else { } else {
$c->app->log->warn('Unknown Driver Used'); $c->app->log->warn('Unknown Driver Used');
return undef; return;
} }
} }

View file

@ -79,7 +79,7 @@ sub pg_or_sqlite {
return \$sqlite_sql; return \$sqlite_sql;
} else { } else {
$c->app->log->warn('Unknown Driver Used'); $c->app->log->warn('Unknown Driver Used');
return undef; return;
} }
} }

View file

@ -505,7 +505,7 @@ sub pg_or_sqlite {
return \$sqlite_sql; return \$sqlite_sql;
} else { } else {
$c->app->log->warn('Unknown Driver Used'); $c->app->log->warn('Unknown Driver Used');
return undef; return;
} }
} }

View file

@ -160,7 +160,7 @@ sub pg_or_sqlite {
return \$sqlite_sql; return \$sqlite_sql;
} else { } else {
$c->app->log->warn('Unknown Driver Used'); $c->app->log->warn('Unknown Driver Used');
return undef; return;
} }
} }

View file

@ -16,7 +16,7 @@ sub under {
return 1; return 1;
} }
$c->redirect_to('/'); $c->redirect_to('/');
return undef; return;
} }
sub auth_login { sub auth_login {

View file

@ -13,7 +13,7 @@ sub get_latest {
my $type_result = $self->find_by_type( $type ); my $type_result = $self->find_by_type( $type );
return undef unless defined $type_result; return unless defined $type_result;
my $latest = $type_result->search_related('sets', {}, { my $latest = $type_result->search_related('sets', {}, {
order_by => { -desc => 'date' }, order_by => { -desc => 'date' },
@ -29,7 +29,7 @@ sub create_new {
my $type_result = $self->find_by_type($type); my $type_result = $self->find_by_type($type);
return undef unless $type_result; return unless $type_result;
return $type_result->create_new($date); return $type_result->create_new($date);
} }

View file

@ -1,5 +1,8 @@
package Pear::LocalLoop::Schema::Script::DeploymentHandler; package Pear::LocalLoop::Schema::Script::DeploymentHandler;
use strict;
use warnings;
use MooX::Options::Actions; use MooX::Options::Actions;
use Module::Runtime qw/ use_module /; use Module::Runtime qw/ use_module /;
use DBIx::Class::DeploymentHandler; use DBIx::Class::DeploymentHandler;