Skip to content
Open
Show file tree
Hide file tree
Changes from 11 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
32 changes: 32 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?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__)
// 💡 additional files, eg bin entry file
// ->append([__DIR__.'/bin-entry-file'])
// 💡 folders to exclude, if any
// ->exclude([/* ... */])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would add an `exclude(['var']) here since it contains all the cache and logs. Would save us time on php formatting. Ran a quick test and it significantly reduces the amount of files formatted!

// 💡 path patterns to exclude, if any
// ->notPath([/* ... */])
// 💡 extra configs
// ->ignoreDotFiles(false) // true by default in v3, false in v4 or future mode
// ->ignoreVCS(true) // true by default
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably would remove the lightbulb emoji as it adds nothing. If we're keeping some of these lines commented out because we might use them in the future, that's okay to keep; the ones we don't are good to remove.

;
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: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ enableImmutableInstalls: false
enableScripts: true

nodeLinker: node-modules

npmMinimalAgeGate: 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unless there's a good reason for this one, I'd remove it. If we don't have it defined, there's an implied age gate of 1 day, which helps when there's package versions released with awful breaking errors or security vulnerabilities.

29 changes: 27 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ down:
$(COMPOSE) down

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

# ──────────────────────────────────────────────
Expand Down Expand Up @@ -87,12 +87,37 @@ 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
# ──────────────────────────────────────────────

frontend-fmt:
$(COMPOSE) run yarn yarn pretty

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

backend-fmt:
$(COMPOSE) run --rm composer format

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

format: frontend-fmt backend-fmt

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another typo


# ──────────────────────────────────────────────
# Institution Seeding
# ──────────────────────────────────────────────

## Insert institution row (MySQL)
## Reads variables from .ins.env
## Reads variablems from .ins.env

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

ins-mysql:
docker exec -it udoit3-db mysql -u root -proot udoit3 \
-e "INSERT INTO institution \
Expand Down
11 changes: 10 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,10 @@
"symfony/polyfill-php83": "*",
"symfony/polyfill-php84": "*"
},
"scripts": {},
"scripts": {
"format": "./vendor/bin/php-cs-fixer fix",
"lint": "vendor/bin/phpstan analyse src tests"
},
"conflict": {
"symfony/symfony": "*"
},
Expand Down
Loading
Loading