pkp / pkp-lib

The library used by PKP's applications OJS, OMP and OPS, open source software for scholarly publishing.
https://pkp.sfu.ca
GNU General Public License v3.0
297 stars 443 forks source link

Code formatter is skipping some files #7017

Closed NateWr closed 3 years ago

NateWr commented 3 years ago

The code formatter is skipping some files because the exclusion rules do not declare top-level directories but any matching files. So excluding plugins is excluding anthing with that in the name.

We probably should use notPath rather than exclude: https://symfony.com/doc/current/components/finder.html

(h/t @asmecher)

NateWr commented 3 years ago

When fixing this, we should also introduce a new formatting rule that orders use imports alphabetically: https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/3.0/doc/rules/import/ordered_imports.rst Nevermind this is already applied.

jonasraoni commented 3 years ago

Perhaps there's a Smarty template formatter out there as well :) Also, I think such cases will probably have to be manually fixed:

$sql = '
<tab>SELECT ...
';
NateWr commented 3 years ago

PRs: https://github.com/pkp/pkp-lib/pull/7123 https://github.com/pkp/ojs/pull/3153 https://github.com/pkp/omp/pull/984 https://github.com/pkp/ops/pull/163

NateWr commented 3 years ago

All merged to main.