mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-31 12:43:14 +00:00
Move long lines check to PHP_CodeSniffer
This commit is contained in:
@@ -76,14 +76,6 @@ if [[ ! -z "${trailing_whitespace}" ]]; then
|
||||
errors+=("${result}")
|
||||
fi
|
||||
|
||||
# Prohibit long lines in php files.
|
||||
long_lines=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" ! -path "*/www/*" -exec awk '{print FILENAME":"NR" "length}' {} \; | awk '$2 > 120')
|
||||
if [[ ! -z "${long_lines}" ]]; then
|
||||
result="$(echo -e "${long_lines}" | perl -pe 's/^(.*)$/Long lines found in \1/')"
|
||||
echo "${result}"
|
||||
errors+=("${result}")
|
||||
fi
|
||||
|
||||
# Require identical comparison operators (===, not ==) in php files.
|
||||
equal=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec grep --color=always --extended-regexp --line-number -H "[^!=]==[^=]" {} \;)
|
||||
if [[ ! -z "${equal}" ]]; then
|
||||
|
||||
@@ -18,6 +18,13 @@
|
||||
<exclude name="PSR12.Properties.ConstantVisibility.NotFound" />
|
||||
</rule>
|
||||
|
||||
<!-- Prohibit long lines in php files. -->
|
||||
<rule ref="Generic.Files.LineLength">
|
||||
<properties>
|
||||
<property name="absoluteLineLimit" value="120"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Disable "No PHP code was found in this file" for symlinks. -->
|
||||
<rule ref="Internal.NoCodeFound">
|
||||
<severity>0</severity>
|
||||
|
||||
Reference in New Issue
Block a user