Skip to content
Snippets Groups Projects
Commit 6c1bca66 authored by Klaus Purer's avatar Klaus Purer
Browse files

Merge remote-tracking branch 'origin/7.x-2.x' into 8.x-2.x

parents 05284a9b c9f0e113
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@
/**
* Drupal_Sniffs_Files_TxtFileLineLengthSniff.
*
* Checks all lines in a *.txt file and throws warnings if they are over 80
* Checks all lines in a *.txt or *.md file and throws warnings if they are over 80
* characters in length.
*
* @category PHP
......@@ -49,7 +49,7 @@ class Drupal_Sniffs_Files_TxtFileLineLengthSniff implements PHP_CodeSniffer_Snif
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$fileExtension = strtolower(substr($phpcsFile->getFilename(), -3));
if ($fileExtension === 'txt') {
if ($fileExtension === 'txt' || $fileExtension === '.md') {
$tokens = $phpcsFile->getTokens();
$content = rtrim($tokens[$stackPtr]['content']);
......
......@@ -7,6 +7,7 @@
<!-- Usually there is no code in txt or info files, so we suppress warnings about
PHP short tags and what not. -->
<exclude-pattern>*.txt</exclude-pattern>
<exclude-pattern>*.md</exclude-pattern>
<exclude-pattern>*.info</exclude-pattern>
</rule>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment