-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[WIP] Fix #3007: Added silencing of the output in initial and cleanup commands #4933
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
[WIP] Fix #3007: Added silencing of the output in initial and cleanup commands #4933
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, and thank you for opening this PR! 🎉
All contributors have signed the CLA, thank you! ❤️
Commit Messages
We want to keep history, but for that to actually be useful we have
some rules on how to format our commit messages (relevant xkcd).
Please stick to these guidelines for commit messages:
- Separate subject from body with a blank line
- When fixing an issue, start your commit message with
Fix #<ISSUE-NBR>:
- Limit the subject line to 72 characters
- Capitalize the subject line
- Do not end the subject line with a period
- Use the imperative mood in the subject line ("Add" instead of "Added")
- Wrap the body at 80 characters
- Use the body to explain what and why vs. how
adapted from https://chris.beams.io/posts/git-commit
Have an awesome day! ☀️
Thanks @SzymonPajzert. I'll take a look when I'm back from vacation |
I think this is the right approach to implement a silent mode for the REPL. However, the issue description was erroneous and The silent mode could be useful to implement value bindings. I would implement everything in ConsoleInterface. Something along the line of: val driver = new ReplDriver(completeArgs, classLoader = Some(loader))
val initState = driver.initState
val s0 = (bindNames, bindValues).zipped.folLeft(initState) {
case (state, (name, value)) => driver.bind(name, value)(state)
}
val s1 = driver.run(initialCommands)(s0)
// handle failure during initialisation
val s2 = driver.runUntilQuit(s1)
driver.run(s1) Value bindings can be implemented in a different PR |
89cb462
to
5027832
Compare
|
||
val s0 = driver.bindValues((bindNames, bindValues).zipped) | ||
val s1 = driver.run(initialCommands)(s0) | ||
// TODO handle failure during initialisation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need to open issues for this and value bindings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have created #5069 to implement the bindings, but I don't understand how failure during initialization should be signaled. Should we mark it with some checked exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes the current API that returns a state is not ideal. Let's not worry about it here, it can be fixed in a separate PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM. Please squash your commits
9f1c3dd
to
a315ec3
Compare
Is there any linter available to not submit changes with nitpicks? |
No. At some point we talked about using scalafmt, but we decided not to enforce a specific style One last think before we merge (sorry I didn't spot it earlier). Can you update the commit message to not mention silencing anymore. Something like: |
a315ec3
to
aefd7cf
Compare
Thanks @SzymonPajzert! 🎉 |
Implementing the feature requested in #3007 by dropping the output of the executed commands.