oliverdavies.uk/source/_daily_emails/2024-09-23.md
Oliver Davies cb70ba752c Add daily email for 2024-09-23
Enforcing consistency with automation
2024-09-27 20:49:22 +01:00

1.3 KiB

title date permalink tags cta snippet
Enforcing consistency with automation 2024-09-23 daily/2024/09/23/enforce-consistency-with-automation
software-development
~ Enforcing consistency with automation.

If you're trying to keep your code consistent, such as following the same coding style or following conventions such as find vs get or design systems such as repositories or builder classes, instead of relying on manual code review and taking the time of a colleague, you can leverage automation to run checks for you.

You can run tools such as phpcs or eslint to enforce a coding style and use Git hooks or a CI pipeline to run them automatically or integrate them into your text editor or IDE so you can see and resolve issues as the code is being written.

You can use static analysis tools such as PHPStan to find potential bugs but also enforce conventions by writing custom rules for your project or using architectural testing tools such as PHPat.

By automating checks, you'll have a consistent result every time and don't need to wait for someone else to find small issues you could have fixed quickly.