A recent change has included *.md in the line length checks. I'm now getting warnings that my line is exceeding 80 chars, causing tests to fail. Unfortunately, the line in question is markdown (a build status image with a link) and so cannot be broken down into multiple lines, or the markdown wont build correctly. The failing line is:

[![Build Status](https://travis-ci.org/FreelyGive/decoupled_auth.png)](https://travis-ci.org/FreelyGive/decoupled_auth)

I have worked round it for now by using references, but even that is still on the brink of breaking (especially if I were to use a title as well as alt text). I think the ideal would be to do some kind of exclude for lines that are start with markdown that needs to stay on a single line. Possible examples are (pardon my iffy regex):

  • Headers: ^#.+
  • Links: ^\[.+\](\[|\().+(\]|\))$ ([Title](Url) and [Title][ref])
  • Images: ^\!\[.+\](\[|\().+(\]|\))$ (![Alt](Url) and [Alt][ref])
  • References (used in images and links): ^\[.+\]: .+
  • Tables(?): ^|.+|$

Comments

andrewbelcher created an issue. See original summary.

bircher’s picture

I was about to open the same issue :D

So another problem is that in markdown you can't even disable the code sniffer with something like:

<!---
// @codingStandardsIgnoreStart
--->
[![Build Status](https://travis-ci.org/nuvoleweb/config_filter.svg?branch=8.x-1.x)](https://travis-ci.org/nuvoleweb/config_filter)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/nuvoleweb/config_filter/badges/quality-score.png?b=8.x-1.x)](https://scrutinizer-ci.com/g/nuvoleweb/config_filter/?branch=8.x-1.x)
<!---
// @codingStandardsIgnoreEnd
--->
andrewbelcher’s picture

@bircher the workaround for you which I think should pass tests is:

[![Build Status][build_image]][build_link]
[build_image]:https://travis-ci.org/nuvoleweb/config_filter.svg?branch=8.x-1.x
[build_link]:https://travis-ci.org/nuvoleweb/config_filter
[![Scrutinizer Code Quality][scrutinizer_image]][scrutinizer_link]
[scrutinizer_image]:https://scrutinizer-ci.com/g/nuvoleweb/config_filter/badges/quality-score.png?b=8.x-1.x
[scrutinizer_link]:https://scrutinizer-ci.com/g/nuvoleweb/config_filter/?branch=8.x-1.x

  • klausi committed 6c357ae on 8.x-2.x
    fix(TxtFileLineLengthSniff): Allow markdown headings, URLs, tables to...

klausi credited klausi.

klausi credited klausi.

klausi’s picture

Status: Active » Fixed

Pushed a fix, thanks for reporting!

andrewbelcher’s picture

Awesome, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.