question-mark
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.

[BUG] no lexer for filename 'xxx' found

See original GitHub issue

Describe the bug At the top of the tracebacks for my tool on exceptions I’m getting the following (see this GitHub Actions workflow):

╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /opt/hostedtoolcache/Python/3.7.9/x64/bin/nf-core:8 in <module>              │
│                                                                              │
│ no lexer for filename 'nf-core' found                                        │

Alternatively, if testing locally:

╭─────────────────────── Traceback (most recent call last) ───────────────────────╮
│ /Users/ewels/miniconda3/envs/py3/bin/nf-core:33 in <module>                     │
│                                                                                 │
│ no lexer for filename 'nf-core' found                                           │

Syntax highlighting in the traceback does work correctly locally.

To Reproduce Any traceback from https://github.com/nf-core/tools has this warning. To test locally I added an assert False statement here and ran nf-core list.

Platform Linux (GitHub Actions), Mac OSX (locally).

Diagnose

python -m rich.diagnose
❯ python -m rich.diagnose
╭────────────────────────────────────────────────────────── <class 'rich.console.Console'> ───────────────────────────────────────────────────────────╮
│ A high level console interface.                                                                                                                     │
│                                                                                                                                                     │
│ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ <console width=151 ColorSystem.TRUECOLOR>                                                                                                       │ │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                                                                     │
│     color_system = 'truecolor'                                                                                                                      │
│         encoding = 'utf-8'                                                                                                                          │
│             file = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>                                                                    │
│ is_dumb_terminal = False                                                                                                                            │
│       is_jupyter = False                                                                                                                            │
│      is_terminal = True                                                                                                                             │
│   legacy_windows = False                                                                                                                            │
│         no_color = False                                                                                                                            │
│          options = ConsoleOptions(legacy_windows=False, min_width=1, max_width=151, is_terminal=True, encoding='utf-8', justify=None,               │
│                    overflow=None, no_wrap=False, highlight=None)                                                                                    │
│           record = False                                                                                                                            │
│         safe_box = True                                                                                                                             │
│             size = ConsoleDimensions(width=151, height=43)                                                                                          │
│        soft_wrap = False                                                                                                                            │
│           stderr = False                                                                                                                            │
│            style = None                                                                                                                             │
│         tab_size = 8                                                                                                                                │
│            width = 151                                                                                                                              │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
python -m rich._windows
 ❯ python -m rich._windows
platform="Darwin"
WindowsConsoleFeatures(vt=False, truecolor=False)
pip freeze | grep rich
 ❯ pip freeze | grep rich
rich==9.10.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
willmcgugancommented, Feb 16, 2021

Should be fixed in 9.11.0

1reaction
willmcgugancommented, Feb 8, 2021

I guess you could also look at the file hashbang if present? But probably not super precise either.

True, if the first line starts with hash bang and contains the text “python” assume a Python lexer, otherwise plain text. Seems like a reasonable approach.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compiling seperate lexer and parser in subdirectory fails #638
Fails with: error(3): cannot find tokens file 'build/Lexer.tokens' ... failes to find lexer.tokens as build/src/foo/ is not it's search path.
Read more >
What is the wrong with the simple ANTLR grammar?
1 Answer 1 ... And no, the lexer will not backtrack to "give up" the character "[" from ": [" to match the...
Read more >
CudaText plugins - Free Pascal wiki
Comment chars are editable in SynWrite editor, in dialog "Lexer properties" ... If file name (without path) matches any of these wildcards, ...
Read more >
Scintilla Documentation
Scintilla 5 has moved the lexers from Scintilla into a new Lexilla ... GTK sample which can be used to find bugs or...
Read more >
Project 3 — Lexer (Java) - St. Lawrence University
Danger! Do not submit any pre-compiled jar files with your submisison. This includes, but is not limited to, your lexer, JFlex, etc. The ......
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found