Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add line-ending detection to linter

See original GitHub issue

Seems like a bad meta.yaml with CRLF gummed up the works for a bunch of folks on staged-recipes… it seems reasonable to detect and warn about line endings.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:19 (19 by maintainers)

github_iconTop GitHub Comments

beckermrcommented, Sep 27, 2021

Yes. This is just for when the linter checks out the code so that it can find the offending line endings without git getting in the way.

BastianZimcommented, Sep 27, 2021

Found another thing:

When reading input from the stream, if newline is None, universal newlines mode is enabled. Lines in the input can end in ‘\n’, ‘\r’, or ‘\r\n’, and these are translated into ‘\n’ before being returned to the caller. If it is ‘’, universal newlines mode is enabled, but line endings are returned to the caller untranslated. If it has any of the other legal values, input lines are only terminated by the given string, and the line ending is returned to the caller untranslated.

So setting the option '' should give us the unchanged output, if I understand this correctly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

An option to enforce certain line endings (LF / CRLF) #5320
If someone accidentally adds \r to this first line and Prettier keeps it, ... Note that the files with CRLF are covered by...
Read more >
How can I write a ESLint rule for "linebreak-style", changing ...
This rule enforces that all line endings are always unix consistent ( \n ) each ... and under rules add the linebreak option...
Read more >
Automatically format and lint code with pre-commit - Interrupt
How to use pre-commit for automated linting, formatting, and styling firmware code by using Python, clang-format, clang-tidy, and prettier.
Read more >
Invalid highlights for CRLF line endings when using typescript ...
The errors are shown as Warning:(1, 32) tslint: Insert ␍ (prettier) If I run npm run lint then linter does not show any...
Read more >
D17814 Detect trailing spaces and tabs - Phabricator
but generally seems to work while preserving line endings. If you'd like I can send testfile to paste or add to this diff...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found