Skip to content

Commit

Permalink
Merge pull request #1 from Tschucki/refactor/code-quality
Browse files Browse the repository at this point in the history
Try to impove Code Quality by adding some github actions & more
  • Loading branch information
Tschucki authored Feb 21, 2024
2 parents 6c5b859 + b2c4e4c commit 119803c
Show file tree
Hide file tree
Showing 169 changed files with 3,200 additions and 893 deletions.
17 changes: 17 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
extends: [
'eslint:recommended',
'plugin:vue/vue3-recommended',
'prettier'
],
plugins: ['prettier'],
rules: {
'vue/no-unused-properties': ['error'],
'vue/no-v-html': 'off',
'vue/multi-word-component-names': 'off',
'prettier/prettier': ['error'],
'vue/require-default-prop': 'off',
'vue/singleline-html-element-content-newline': 0,
'vue/component-name-in-template-casing': ['error', 'PascalCase'],
},
}
File renamed without changes.
29 changes: 29 additions & 0 deletions .github/workflows/composer-validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Composer Validate

on:
push:
paths:
- 'composer.json'
- 'composer-lock.json'
pull_request:
paths:
- 'composer.json'
- 'composer-lock.json'

jobs:
composer_validate:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Install Composer
uses: php-actions/composer@v6
with:
php_extensions: intl zip

- name: Validate Composer files
run: composer validate
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
name: "Fix PHP Code Styling"
name: "Fix Code Styling"

on:
push:
paths:
- '**.php'
- 'resources'
pull_request:
paths:
- '**.php'
- 'resources'

permissions:
contents: write

jobs:
php-code-styling:
fix-code-styling:
runs-on: ubuntu-latest

steps:
Expand All @@ -18,6 +23,17 @@ jobs:
with:
ref: ${{ github.head_ref }}

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 21

- name: Install Dependencies
run: npm install

- name: Run Prettier
run: npm run prettier

- name: Fix PHP code style issues
uses: aglipanci/laravel-pint-action@2.3.1

Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/lint-js-code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "JavaScript Code Linting"

on:
push:
paths:
- 'resources'
pull_request:
paths:
- 'resources'

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 21

- name: Install Dependencies
run: npm install

- name: ESLint
run: npm run lint
9 changes: 9 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"printWidth": 80,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"bracketSpacing": true,
"bracketSameLine": true,
"trailingComma": "es5"
}
23 changes: 7 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<br/>
<a href="https://pr0p0ll.com">Visit Website</a>
.
<a href="https://github.com/pr0p0ll/pr0p0ll/issues">Report Bug</a>
<a href="https://github.com/Tschucki/pr0p0ll/issues">Report Bug</a>
.
<a href="https://github.com/pr0p0ll/pr0p0ll/issues">Request Feature</a>
<a href="https://github.com/Tschucki/pr0p0ll/issues">Request Feature</a>
</p>
</p>

Expand All @@ -32,11 +32,7 @@

## About The Project

![Screen Shot](art/targetgroup-screenshot.png)
![Screen Shot](art/participate-screenshot.png)
![Screen Shot](art/results-screenshot.png)

Pr0p0ll ist eine Plattform für Pr0gramm-User, um Umfragen zu erstellen und an diesen teilzunehmen. Der Betreiber der alten Platform (Rundesballi) hat das Projekt an Tschucki übergeben und hat die Plattform neu entwickelt. Die neue Plattform ist mit Laravel 10 und Filament 3 entwickelt worden. Um Zugang zur Plattform zu erhalten loggt sich der Benutzer über O-Auth ein.
Pr0p0ll ist eine Plattform für Pr0gramm-User, um Umfragen zu erstellen und an diesen teilzunehmen. Der Betreiber der alten Platform (RundesBalli) hat das Projekt an Tschucki übergeben und hat die Plattform neu entwickelt. Die neue Plattform ist mit Laravel 10 und Filament 3 entwickelt worden. Um Zugang zur Plattform zu erhalten loggt sich der Benutzer über O-Auth ein.

### Features

Expand All @@ -55,20 +51,15 @@ Pr0p0ll is built with the following:
* Vue
* TailwindCSS

## Getting Started

This is an example of how you may give instructions on setting up your project locally.
To get a local copy up and running follow these simple example steps.

## Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any
contributions you make are **greatly appreciated**.

* If you have suggestions for adding or removing projects, feel free
to [open an issue](https://github.com/pr0p0ll/pr0p0ll/issues/new) to discuss it, or directly create a pull request.
to [open an issue](https://github.com/Tschucki/pr0p0ll/issues/new) to discuss it, or directly create a pull request.
* Create individual PR for each suggestion.
* Please also read through the [Code Of Conduct](https://github.com/pr0p0ll/pr0p0ll/blob/main/CODE_OF_CONDUCT.md) before
* Please also read through the [Code Of Conduct](https://github.com/Tschucki/pr0p0ll/blob/main/.github/CODE_OF_CONDUCT.md) before
posting your first idea as well.

### Creating A Pull Request
Expand All @@ -81,7 +72,7 @@ contributions you make are **greatly appreciated**.

## License

Distributed under the MIT License. See [LICENSE](https://github.com/pr0p0ll/pr0p0ll/blob/main/LICENSE.md) for more
Distributed under the MIT License. See [LICENSE](https://github.com/Tschucki/pr0p0ll/blob/main/LICENSE.md) for more
information.

## Authors
Expand All @@ -90,4 +81,4 @@ information.

## Acknowledgements

* [Rundesballi](https://github.com/RundesBalli)
* [RundesBalli](https://github.com/RundesBalli)
2 changes: 2 additions & 0 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
Expand Down
2 changes: 2 additions & 0 deletions app/Enums/ClosesAfter.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Enums;

use Filament\Support\Contracts\HasLabel;
Expand Down
2 changes: 2 additions & 0 deletions app/Enums/Gender.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Enums;

use Filament\Support\Contracts\HasLabel;
Expand Down
2 changes: 2 additions & 0 deletions app/Enums/Nationality.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Enums;

use Filament\Support\Contracts\HasLabel;
Expand Down
2 changes: 2 additions & 0 deletions app/Enums/QuestionType.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Enums;

use Filament\Support\Contracts\HasLabel;
Expand Down
2 changes: 2 additions & 0 deletions app/Enums/Region.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Enums;

use Filament\Support\Contracts\HasLabel;
Expand Down
2 changes: 2 additions & 0 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Exceptions;

use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
Expand Down
2 changes: 2 additions & 0 deletions app/Filament/Actions/ApprovePollAction.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Filament\Actions;

use App\Models\Polls\Poll;
Expand Down
2 changes: 2 additions & 0 deletions app/Filament/Actions/DenyPollAction.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Filament\Actions;

use App\Models\Polls\Poll;
Expand Down
2 changes: 2 additions & 0 deletions app/Filament/Actions/DisablePollAction.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Filament\Actions;

use App\Models\Polls\Poll;
Expand Down
4 changes: 3 additions & 1 deletion app/Filament/Actions/PollPreviewAction.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php

declare(strict_types=1);

namespace App\Filament\Actions;

use App\Abstracts\Poll;
use App\Models\Abstracts\Poll;
use App\Services\PollFormService;
use Filament\Actions\Action;
use Filament\Forms\Components\Placeholder;
Expand Down
2 changes: 2 additions & 0 deletions app/Filament/Actions/SubmitForReviewAction.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Filament\Actions;

use App\Models\Polls\MyPoll;
Expand Down
4 changes: 3 additions & 1 deletion app/Filament/Pages/Login.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Filament\Pages;

use DanHarrin\LivewireRateLimiting\Exceptions\TooManyRequestsException;
Expand Down Expand Up @@ -58,7 +60,7 @@ public function login()
->danger()
->send();

return null;
return;
}

return \Redirect::route('oauth.start');
Expand Down
2 changes: 2 additions & 0 deletions app/Filament/Pages/UpdateUserData.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Filament\Pages;

use App\Enums\Gender;
Expand Down
2 changes: 2 additions & 0 deletions app/Filament/Resources/AllPollsResource.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Filament\Resources;

use App\Enums\ClosesAfter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Filament\Resources\AllPollsResource\Pages;

use App\Filament\Resources\AllPollsResource;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Filament\Resources\AllPollsResource\Pages;

use App\Filament\Actions\ApprovePollAction;
Expand Down
2 changes: 2 additions & 0 deletions app/Filament/Resources/CategoryResource.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Filament\Resources;

use App\Filament\Resources\CategoryResource\Pages;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Filament\Resources\CategoryResource\Pages;

use App\Filament\Resources\CategoryResource;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Filament\Resources\CategoryResource\Pages;

use App\Filament\Resources\CategoryResource;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Filament\Resources\CategoryResource\Pages;

use App\Filament\Resources\CategoryResource;
Expand Down
Loading

0 comments on commit 119803c

Please sign in to comment.