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

Apply linter fixes (#3708) #3996

Open
wants to merge 4 commits into
base: ci4-branch
Choose a base branch
from
Open

Apply linter fixes (#3708) #3996

wants to merge 4 commits into from

Conversation

jekkos
Copy link
Member

@jekkos jekkos commented May 13, 2024

Ran this command locally and then pushed the output
vendor/bin/php-cs-fixer fix --verbose --ansi --config=.php-cs-fixer.no-header.php --using-cache=no --diff

public string $application_version = '3.4.0-dev';
/**
* This is the code version of the Open Source Point of Sale you're running.
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jekkos I like the idea of the linter, but we may need to make some adjustments. One area where I can foresee some problems is that when we need to update CI to a new version it involves doing a diff on a lot of these config files because there are changes in them. If our linter has significantly changed them, it makes the diff super messy and takes longer to differentiate which things are just linter changes and which things are changes by CI4.

@@ -3,56 +3,45 @@
namespace Config;

use CodeIgniter\Config\BaseConfig;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not have been removed.

@objecttothis
Copy link
Member

Also, the default rules for this linter change a few standards that we currently have. Are we changing those? For example currently the project uses tabs, but the CS Fixer default ruleset uses 4 spaces.

@objecttothis
Copy link
Member

I looked into it a little and the way to customize the rules would be to create a .php_cs.dist file in the root of the project and configure it the way we want it. We would need to use the same ruleset in the build checks as we use in development though or it will fail checks.

@objecttothis
Copy link
Member

Also, when I installed cs-fixer it defaulted to PSR-2, but PSR-12 is the current best practice for coding standards rulesets.

@objecttothis
Copy link
Member

I looked into it a little and the way to customize the rules would be to create a .php_cs.dist file in the root of the project and configure it the way we want it. We would need to use the same ruleset in the build checks as we use in development though or it will fail checks.

I guess the correct name is .php-cs-fixer.dist.php not .php_cs.dist which is old.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants