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

Fix line formatting of error message #586

Merged
merged 1 commit into from
Apr 30, 2022
Merged

Conversation

Aster89
Copy link
Contributor

@Aster89 Aster89 commented Apr 30, 2022

From a conversation on gitter:

As regards this latter nuisance I think it's due to

self._logger.info( "Launch failed: %s", '\n'.join( text ) )

it's probably this actually:

should probably be reason.splitlines()


This is the first code ever I write in Python. I'm happy to learn what's wrong (or what would be better) with it 😄

@puremourning
Copy link
Owner

This change is Reviewable

Comment on lines 1516 to 1522
text = [ line for lines in [
'Launch Failed',
'',
reason.splitlines(),
'',
'Use :VimspectorReset to close'
] for line in ( lines if isinstance( lines, list ) else [ lines ] )
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I can make this more readable by wrapping the 4 literal strings into [] and simplify the list comprehension?

Copy link
Owner

@puremourning puremourning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @Aster89 and @puremourning)


python3/vimspector/debug_session.py line 1522 at r1 (raw file):

Previously, Aster89 wrote…

Maybe I can make this more readable by wrapping the 4 literal strings into [] and simplify the list comprehension?

Yeah this is super convoluted. Use python + operator to add the lists together.

Copy link
Owner

@puremourning puremourning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: thanks.

Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @Aster89 and @puremourning)

Copy link
Owner

@puremourning puremourning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Aster89)

Copy link
Owner

@puremourning puremourning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dismissed @Aster89 from a discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Aster89)

@mergify
Copy link
Contributor

mergify bot commented Apr 30, 2022

Thanks for sending a PR!

@mergify mergify bot merged commit 1ed3533 into puremourning:master Apr 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants