Skip to content
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

Enforce PSR-12 and organise imports on Winter CMS core files #1188

Draft
wants to merge 32 commits into
base: develop
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e7ebbb2
Enforce PSR-12 on Winter CMS core files
bennothommo Aug 23, 2024
66bd3f3
Additional code style fixes to improve future diffs and IDE support
bennothommo Aug 23, 2024
dbf6019
Use Composer-derived PHPCS, udpate GitHub Actions
bennothommo Aug 23, 2024
ce14395
Update GitHub Actions
bennothommo Aug 23, 2024
87171ca
Reset modules before checking code quality
bennothommo Aug 23, 2024
e23c0b2
Exclude some rules for partials and views
bennothommo Aug 23, 2024
b2ffbe9
Add rule for array indentation
bennothommo Aug 23, 2024
7b72f82
Fix reference to File facade
bennothommo Aug 23, 2024
2643609
Merge branch 'develop' into fix/psr-12
bennothommo Sep 2, 2024
52a824f
Split off Winter CMS code style ruleset to its own XML
bennothommo Sep 2, 2024
a6b814b
Remove partial from exclusion list
bennothommo Sep 2, 2024
236c459
Add "winter:sniff" command
bennothommo Sep 2, 2024
47fbf2a
Merge branch 'develop' into fix/psr-12
bennothommo Dec 7, 2024
9d1b92f
Fix remaining code smells
bennothommo Dec 7, 2024
b1a5a79
Change alias command
bennothommo Dec 7, 2024
1da2568
Add support for `--fix` option to `sniff` command
LukeTowers Dec 7, 2024
51af67d
Alias `winter:test` to `test`
LukeTowers Dec 7, 2024
0ae77a8
Improve / relocate PHPCS stubs
LukeTowers Dec 11, 2024
1dd04fc
Update composer scripts
LukeTowers Dec 11, 2024
f2e7289
Add class constant visibility
LukeTowers Dec 11, 2024
041dbb1
Fix remaining warnings
LukeTowers Dec 11, 2024
61b127f
Add progress flag to phpcs
LukeTowers Dec 11, 2024
33a1518
Add initial version of NoGlobalAliasesSniffTest
LukeTowers Dec 16, 2024
afedfb9
Add support for --parallel option to winter:sniff
LukeTowers Dec 16, 2024
69f19e3
Fix remaining global imports
LukeTowers Dec 16, 2024
bace8e7
Ignore the project's phpcs.xml file when exporting it as a new project
LukeTowers Dec 16, 2024
16d7cc2
Fix overzealous find/replace
LukeTowers Dec 16, 2024
09b945e
Remove debug code
LukeTowers Dec 16, 2024
02c8469
Use Winter's Url facade instead of Laravel's
LukeTowers Dec 16, 2024
6fe5671
Typo fix
LukeTowers Dec 17, 2024
fb92ce3
Allow use statements to reference classes in the same namespace
LukeTowers Dec 17, 2024
27207c2
Fix default scaffolding stub files to conform to coding standard
LukeTowers Dec 18, 2024
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
Prev Previous commit
Next Next commit
Add support for --fix option to sniff command
  • Loading branch information
LukeTowers authored Dec 7, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 1da2568858ed78b4d3b15dd501272bdc7e0aa545
7 changes: 5 additions & 2 deletions modules/system/console/WinterSniff.php
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@ class WinterSniff extends BaseScaffoldCommand
{?--c|config= : Path to a custom PHPCS configuration XML file}
{?--p|plugin= : Checks the coding style of a plugin}
{?--e|no-warnings : Ignore warnings and only show errors}
{--fix : Automatically fix detected errors where able by use of the phpcbf command}
{?--s|summary : Display a summary of the results}
';

@@ -48,6 +49,7 @@ class WinterSniff extends BaseScaffoldCommand

protected $replaces = [
'winter:phpcs',
'sniff',
];


@@ -203,10 +205,11 @@ public function getPluginIdentifier($identifier = null): string
*/
protected function findPhpCsExecutable(): ?string
{
$binFile = $this->option('fix') ? 'phpcbf' : 'phpcs';
return (new ExecutableFinder())
->find(
'phpcs',
base_path('vendor/bin/phpcs'),
$binFile,
base_path("vendor/bin/$binFile"),
[
base_path('vendor'),
]
Loading