Skip to content

Commit 2c98b1f

Browse files
committed
feat: install Pint and configure code style rules
1 parent 7ed4eb2 commit 2c98b1f

File tree

4 files changed

+60
-3
lines changed

4 files changed

+60
-3
lines changed

composer.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"require-dev": {
1515
"fakerphp/faker": "^1.9.1",
16-
"laravel/pint": "^1.0",
16+
"laravel/pint": "^1.13",
1717
"laravel/sail": "^1.18",
1818
"mockery/mockery": "^1.4.4",
1919
"nunomaduro/collision": "^7.0",
@@ -36,6 +36,10 @@
3636
"scripts": {
3737
"tests": "vendor/bin/phpunit",
3838
"tests:coverage": "vendor/bin/phpunit --coverage-clover coverage.xml",
39+
"pint": "./vendor/bin/pint",
40+
"pint-dirty": "./vendor/bin/pint --dirty",
41+
"pint-test": "./vendor/bin/pint --test",
42+
"pint-test-dirty": "./vendor/bin/pint --test --dirty",
3943
"post-autoload-dump": [
4044
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
4145
"@php artisan package:discover --ansi"

composer.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

database/migrations/2014_10_12_100000_create_password_reset_tokens_table.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
use Illuminate\Database\Schema\Blueprint;
77
use Illuminate\Support\Facades\Schema;
88

9-
return new class extends Migration {
9+
return new class extends Migration
10+
{
1011
public function up(): void
1112
{
1213
Schema::create('password_reset_tokens', function (Blueprint $table) {

pint.json

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"preset": "laravel",
3+
"exclude": [
4+
"config",
5+
"lang"
6+
],
7+
"rules": {
8+
"no_extra_blank_lines": {
9+
"tokens": [
10+
"attribute",
11+
"break",
12+
"case",
13+
"continue",
14+
"curly_brace_block",
15+
"default",
16+
"extra",
17+
"parenthesis_brace_block",
18+
"return",
19+
"square_brace_block",
20+
"switch",
21+
"throw",
22+
"use",
23+
"use_trait"
24+
]
25+
},
26+
"method_argument_space": {
27+
"on_multiline": "ensure_fully_multiline"
28+
},
29+
"align_multiline_comment": true,
30+
"class_definition": {
31+
"single_line": false
32+
},
33+
"new_with_braces": {
34+
"anonymous_class": false,
35+
"named_class": true
36+
},
37+
"global_namespace_import": {
38+
"import_classes": true,
39+
"import_constants": true,
40+
"import_functions": false
41+
},
42+
"is_null": true,
43+
"logical_operators": true,
44+
"no_empty_comment": true,
45+
"ordered_traits": true,
46+
"ternary_to_null_coalescing": true,
47+
"explicit_indirect_variable": true,
48+
"modernize_types_casting": true,
49+
"no_useless_else": true,
50+
"nullable_type_declaration_for_default_null_value": true
51+
}
52+
}

0 commit comments

Comments
 (0)