'how to make opsway/psr12-strict-coding-standard only run on files that are being commited
I am trying to use the composer package opsway/psr12-strict-coding-standard to make my code into psr12 standard, however, when trying to do commits the package runs in my github hook as expected but it runs on all the files in the project, including those which are not being commited, this is an issue due to all the files which do not end in the linux format which is every single file that has not been touched, I do not mind chaning the filetype manually for commit files but changing 20 or so files for a 1 file commit is a bit ridiculous, not sure if this is possible but hopefully there is. Here is the config xml file
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<arg name="basepath" value="."/>
<arg name="cache" value=".phpcs-cache"/>
<arg name="colors"/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="10"/>
<!-- Show progress -->
<arg value="p"/>
<!-- Paths to check -->
<file>app/Http/Controllers</file>
<file>app/Http/Traits</file>
<file>app/Http/Requests</file>
<file>app/Models</file>
<file>routes</file>
<!-- Include all rules from the Zend Coding Standard -->
<rule ref="OpsWayStrictPSR12CodingStandard"/>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
