Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
!/assets/js/Components/Icons/
###< symfony/framework-bundle ###

###> php linter cache ###
.php-cs-fixer.*
###> php linter cache ###
###> friendsofphp/php-cs-fixer ###
/.php-cs-fixer.php
/.php-cs-fixer.cache
###< friendsofphp/php-cs-fixer ###

###> symfony/phpunit-bridge ###
.phpunit
Expand Down Expand Up @@ -49,4 +50,8 @@ yarn-error.log
.phpunit.result.cache
###< phpunit/phpunit ###

*.env
###> phpstan/phpstan ###
phpstan.neon
###< phpstan/phpstan ###

*.env
24 changes: 24 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Config;
use PhpCsFixer\Finder;

return (new Config())
->setRiskyAllowed(false)
->setRules([
'@auto' => true,
'@PhpCsFixer' => true,
'@Symfony' => true,

'phpdoc_summary' => false,
])
// By default, Fixer looks for `*.php` files excluding `./vendor/` - here, you can groom this config
->setFinder(
(new Finder())
// 💡 root folder to check
->in(__DIR__)
->exclude(['var'])
)
;
29 changes: 29 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Dependencies
node_modules/

# Build outputs
build/

# Package manager lockfiles
package-lock.json
yarn.lock

# Logs
*.log

# Environment files
.env
.env.*

# Generated files
*.min.js
*.min.css
*.generated.*
generated/

# Cache directories
.var/

# IDE files
.vscode/
.idea/
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"experimentalTernaries": true,
"experimentalOperatorPosition": "start"
}
2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ enableImmutableInstalls: false

enableScripts: true

nodeLinker: node-modules
nodeLinker: node-modules
51 changes: 49 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ ifneq (,$(wildcard ./.ins.env))
include .ins.env
export
endif

# ──────────────────────────────────────────────
# Variables
# ──────────────────────────────────────────────
Expand All @@ -23,7 +22,7 @@ down:
$(COMPOSE) down

## Rebuild the containers from the ground up
build:
rebuild:
$(COMPOSE) up --build

# ──────────────────────────────────────────────
Expand Down Expand Up @@ -70,11 +69,25 @@ migrate-down:
# Utilities
# ──────────────────────────────────────────────

.PHONY: clean-cache purge-symfony

## Clear the Symfony cache
clean-cache:
$(COMPOSE) run --rm php bin/console cache:clear
rm -rf ./var/cache/prod/

purge-symfony:
rm -rf vendor ./var/cache

frontend-install:
$(COMPOSE) run --rm yarn yarn install

backend-install:
$(COMPOSE) run --rm composer composer install --no-interaction --no-progress --optimize-autoloader

install-deps: frontend-install backend-install


.PHONY: admin-panel-retrieve-data

VALID_TABLES := accounts terms courses
Expand All @@ -87,6 +100,40 @@ admin-panel-retrieve-data: clean-cache
exit 1; \
fi
$(COMPOSE) run --rm php php bin/console app:admin-panel-retrieval $(foreach table,$(TABLES),--tables=$(table))

# ──────────────────────────────────────────────
# Formatting and Linting
# ──────────────────────────────────────────────

# All of these commands require dev dependencies to be installed
# Make sure your APP_ENV is "dev" when you install dependencies

# To run these two commands, ensure your node_modules is up to date.
# If it isn't, run frontend-install
frontend-fmt:
$(COMPOSE) run --rm yarn yarn pretty

frontend-lint:
$(COMPOSE) run --rm yarn yarn lint

# To run these two commands, ensure your vendor folder is up to date.
# If it isn't, run backend-install
backend-fmt:
@composer run-script --list | grep -q ''
$(COMPOSE) run --rm composer composer format

backend-lint:
$(COMPOSE) run --rm composer composer lint


format: frontend-fmt backend-fmt

lint:
@frontend_rc=0; backend_rc=0; \
$(MAKE) frontend-lint || frontend_rc=$$?; \
$(MAKE) backend-lint || backend_rc=$$?; \
[ $$frontend_rc -eq 0 ] && [ $$backend_rc -eq 0 ]

# ──────────────────────────────────────────────
# Institution Seeding
# ──────────────────────────────────────────────
Expand Down
16 changes: 15 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^4.3",
"friendsofphp/php-cs-fixer": "^3.95",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^2.2",
"phpstan/phpstan-beberlei-assert": "^2.0",
"phpstan/phpstan-symfony": "^2.0",
"phpunit/phpunit": "^13.0",
"symfony/browser-kit": "^7.4",
"symfony/css-selector": "^7.4",
Expand All @@ -60,6 +65,7 @@
},
"sort-packages": true,
"allow-plugins": {
"phpstan/extension-installer": true,
"symfony/flex": true
}
},
Expand Down Expand Up @@ -89,7 +95,15 @@
"symfony/polyfill-php83": "*",
"symfony/polyfill-php84": "*"
},
"scripts": {},
"scripts": {
"format": "vendor/bin/php-cs-fixer fix",
"lint": [
"@lint:container",
"@lint:phpstan"
],
"lint:phpstan": "vendor/bin/phpstan analyse src tests",
"lint:container": "php bin/console lint:container"
},
"conflict": {
"symfony/symfony": "*"
},
Expand Down
Loading
Loading