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

Add --fix-to-stdout back #298

Closed

Conversation

DamienCassou
Copy link
Contributor

This is fixing #295.

@DamienCassou
Copy link
Contributor Author

The code quality is not there yet but I would appreciate early feedback if you have any.

Copy link
Owner

@mantoni mantoni left a comment

Choose a reason for hiding this comment

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

Thanks for starting this! ❤️

I left some minor comments. Generally the idea seems fine. 👍

Error cases should probably always print to console.error and write the input to stdout, so that the original text is preserved. Could be annoying otherwise. What do you think?

@DamienCassou DamienCassou force-pushed the add-fix-to-stdout-back branch 9 times, most recently from 71d04ee to 5e5dad7 Compare July 30, 2024 14:09
@DamienCassou
Copy link
Contributor Author

I improved the code following your review and added a few tests. I need to write more tests and add support for older versions of eslint. Feel free to give me more feedback if you see anything I should pay attention to.

My main problem is that integration tests are flaky now. For the same code, they sometimes pass and sometimes fail:

Given that the integration tests depend on each other (the suite uses after() and not afterEach()), I find it hard to debug. Would you consider having each test independent of the other ones? This way, they would run regardless of the order and running only one test (with it.only() for example) would trigger the same code as if the test was run after another one.

@DamienCassou DamienCassou requested a review from mantoni July 30, 2024 14:15
Copy link
Owner

@mantoni mantoni left a comment

Choose a reason for hiding this comment

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

Nice! Regarding the integration test:

They depend on each other since the first ones start the server, then check for --version and status etc. which I think makes sense.

However, feel free to create a new group for the --fix-to-stdout tests with a before that starts the daemon and an after that stops it. This way you can use only on each of the new tests.

@DamienCassou DamienCassou force-pushed the add-fix-to-stdout-back branch from 5e5dad7 to 4564909 Compare July 30, 2024 15:36
Copy link
Owner

@mantoni mantoni left a comment

Choose a reason for hiding this comment

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

Looking good. I have no more feedback. This just needs tests and the integration tests to pass.

How do you want to proceed regarding the exit code protocol?

Just so I feel safer with the next refactoring.
We want to check what is written to stdout, not the implementation
details of which event handler writes what.
The previous implementation only worked for exit codes of one
character and had repeated magic numbers.
This option was lost in the recent rewrite.
@DamienCassou DamienCassou force-pushed the add-fix-to-stdout-back branch from 10aeb1e to 7d902ab Compare August 1, 2024 15:36
@DamienCassou
Copy link
Contributor Author

We are in a much better state now. The first 4 commits are the same as in #301 so only the last 2 make sense for this one. I think I only need to write a few unit-tests now. As always, feedback appreciated (but you may want to spend your time on #301 instead of this one for now).

@DamienCassou DamienCassou requested a review from mantoni August 1, 2024 15:38
@mantoni mantoni mentioned this pull request Aug 1, 2024
@mantoni
Copy link
Owner

mantoni commented Aug 2, 2024

📦 Released in v14.0.2 via #307 – Thank you so much @DamienCassou for the idea and stepping up to actually do the legwork. Highly appreciated. 🙌

@mantoni mantoni closed this Aug 2, 2024
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.

2 participants