-
Notifications
You must be signed in to change notification settings - Fork 77
Add linting and formatting #1198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from 11 commits
677af58
ad209b2
16b8b69
ccef7ad
d5aa8c8
4739354
e6911f3
7efa651
8421279
1223c1a
1247993
f009ee1
2c39559
dd18b95
3e47cfa
58b95f9
97ad59e
4936d48
d10c777
d9eeb08
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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([/* ... */]) | ||
| // 💡 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 | ||
| ) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| ; | ||
| 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/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "experimentalTernaries": true, | ||
| "experimentalOperatorPosition": "start" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,5 @@ enableImmutableInstalls: false | |
| enableScripts: true | ||
|
|
||
| nodeLinker: node-modules | ||
|
|
||
| npmMinimalAgeGate: 0 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,7 @@ down: | |
| $(COMPOSE) down | ||
|
|
||
| ## Rebuild the containers from the ground up | ||
| build: | ||
| rebuild: | ||
| $(COMPOSE) up --build | ||
|
|
||
| # ────────────────────────────────────────────── | ||
|
|
@@ -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 ] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 \ | ||
|
|
||
There was a problem hiding this comment.
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!