Skip to content

Commit d8df390

Browse files
Add Laravel Pint (#12)
Add a Laravel Pint GitHub Workflow
1 parent 6ce20f1 commit d8df390

33 files changed

+145
-144
lines changed

.github/workflows/style.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Fix Code Styling
2+
3+
on: [ push ]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v3
12+
13+
- name: Setup PHP
14+
uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: "8.1"
17+
extensions: json, dom, curl, libxml, mbstring
18+
coverage: none
19+
20+
- name: Install Pint
21+
run: composer global require laravel/pint
22+
23+
- name: Run Pint
24+
run: pint
25+
26+
- name: Commit linted files
27+
uses: stefanzweifel/git-auto-commit-action@v4
28+
with:
29+
commit_message: "Fix code styling (ci skip)"

pint.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"preset": "laravel"
3+
}

src/Connect/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ public function query()
5757
$this, $this->getQueryGrammar(), $this->getPostProcessor()
5858
);
5959
}
60-
}
60+
}

src/Connect/Connector.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@
99

1010
class Connector extends MySqlConnector
1111
{
12-
13-
}
12+
}

src/Exceptions/SingleStoreDriverException.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77

88
class SingleStoreDriverException extends \Exception
99
{
10-
11-
}
10+
}

src/Exceptions/UnsupportedFunctionException.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77

88
class UnsupportedFunctionException extends SingleStoreDriverException
99
{
10-
11-
}
10+
}

src/Fluency/SpatialIndexCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@
1212
*/
1313
class SpatialIndexCommand extends Fluent
1414
{
15-
16-
}
15+
}

src/Query/Builder.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@
99

1010
class Builder extends BaseBuilder
1111
{
12-
13-
}
12+
}

src/Query/Grammar.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ protected function wrapJsonSelector($value)
7373
// Break apart the column name from the JSON keypath.
7474
[$field, $path] = $this->wrapJsonFieldAndPath($value);
7575

76-
if (!$path) {
76+
if (! $path) {
7777
return $field;
7878
}
7979

@@ -112,9 +112,8 @@ protected function wrapJsonFieldAndPath($column)
112112
return "'$part'";
113113
}, $parts);
114114

115-
$path = count($parts) ? ', ' . implode(", ", $parts) : '';
115+
$path = count($parts) ? ', '.implode(', ', $parts) : '';
116116

117117
return [$field, $path];
118118
}
119-
120-
}
119+
}

src/Schema/Blueprint.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
use Illuminate\Database\Connection;
99
use Illuminate\Database\Schema\Blueprint as BaseBlueprint;
1010
use Illuminate\Database\Schema\Grammars\Grammar;
11+
use SingleStore\Laravel\Schema\Blueprint\AddsTableFlags;
1112
use SingleStore\Laravel\Schema\Blueprint\InlinesIndexes;
1213
use SingleStore\Laravel\Schema\Blueprint\ModifiesIndexes;
13-
use SingleStore\Laravel\Schema\Blueprint\AddsTableFlags;
1414

1515
class Blueprint extends BaseBlueprint
1616
{
@@ -34,5 +34,4 @@ public function toSql(Connection $connection, Grammar $grammar)
3434

3535
return $this->creating() ? $this->inlineCreateIndexStatements($statements) : $statements;
3636
}
37-
38-
}
37+
}

0 commit comments

Comments
 (0)