Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Continue scanning after unhandled errors #946

Closed
Bugzey opened this issue Jan 5, 2024 · 3 comments
Closed

[Feature] Continue scanning after unhandled errors #946

Bugzey opened this issue Jan 5, 2024 · 3 comments

Comments

@Bugzey
Copy link

Bugzey commented Jan 5, 2024

Hi, all.

Currently when scanning multiple documents the scan process exits immediately if it encounters an unhandled error. While we do need to fix errors either in the code or in the document, this stops us from handling linting issues in documents following the one that triggered the error. This could be avoided if broken files are ignored on error, scanning and linting continues to the end of all files and finally we get a list of files with unhandled errors.

This would work similarly to unit test frameworks - they record test failures or code errors but continue running all following tests.

Here is an example trio of files that will trigger the nasty behaviour, leaving file 3.md unchecked:

Example expected output:

file 1.md:1:1: MD022: Headings should be surrounded by blank lines. [Expected: 1; Actual: 0; Below] (blanks-around-headings,blanks-around-headers)
file 1.md:1:2: MD010: Hard tabs [Column: 2] (no-hard-tabs)
file 1.md:3:1: MD032: Lists should be surrounded by blank lines (blanks-around-lists)
file 3.md:1:1: MD022: Headings should be surrounded by blank lines. [Expected: 1; Actual: 0; Below] (blanks-around-headings,blanks-around-headers)
file 3.md:1:2: MD010: Hard tabs [Column: 2] (no-hard-tabs)
file 3.md:3:1: MD032: Lists should be surrounded by blank lines (blanks-around-lists)

Unhandled exceptions caught when processing files:
file 2.md

Actual output:

file 1.md:1:1: MD022: Headings should be surrounded by blank lines. [Expected: 1; Actual: 0; Below] (blanks-around-headings,blanks-around-headers)
file 1.md:1:2: MD010: Hard tabs [Column: 2] (no-hard-tabs)
file 1.md:3:1: MD032: Lists should be surrounded by blank lines (blanks-around-lists)


Unexpected Error(BadTokenizationError): An unhandled error occurred processing the document.

Thank you for your attention!

Best wishes,
Bugzey

@jackdewinter
Copy link
Owner

like the idea... give me a bit to think on how to make it look "right"

@jackdewinter
Copy link
Owner

Was released yesterday, should be available for testing.

@jackdewinter
Copy link
Owner

closing due to lack of response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants