Linting neon files in CI
I have to admit, I am not the best at editing neon configuration files. I regularly mess that up and then things break. How to fix that? Well, why not lint those files in the CI pipeline?
I have to admit, I am not the best at editing neon configuration files. I regularly mess that up and then things break. How to fix that? Well, why not lint those files in the CI pipeline?
A few weeks back at MageTestFest 2019 in Florence, I gave a presentation on QA tools I like and gave some insights how they can be used in a Magento project. One of the tools I mentioned was PHPStan - a static analysis tool. PHPStan helps you to detect a lot of problems in your code due to using wrong types, calling methods that might not exist, passing the wrong number or types of arguments to methods and so on. PHPStan is also able to create your own rule sets of what behavior you want to check for.
About two years ago we agreed on dropping our own company-wide code standard (which in fact was none!) in favour of the common standards used in all the programming languages which we use. That's PSR-1 and PSR-2 for PHP projects, the Java Code conventions for our Java projects and the Puppet Language Style Guide for our Puppet cofigurations. For Javascript we were not able to find the one and only standard out there. So once again we had to jump in and create our "own" standard. However, this time we`d like to share it with the world ;)