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

feat(cli): add --no-clear-screen flag #13454

Merged
merged 8 commits into from
Jan 31, 2022
Merged

Conversation

ah-yu
Copy link
Contributor

@ah-yu ah-yu commented Jan 21, 2022

Closes #13315

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

An integration test would be useful for this flag. See cli/tests/integration/watcher_tests.rs for example tests.

cli/flags.rs Show resolved Hide resolved
@ah-yu
Copy link
Contributor Author

ah-yu commented Jan 22, 2022

Added one integration test deno run --watch --no-clear-screen file.js to test this flag, I am not sure that it is enough or needs to add integration tests of all related subcommands.

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

@ah-yu nice work! I got a few nitpicks but otherwise LGTM

cli/flags.rs Outdated
@@ -1768,6 +1781,8 @@ fn bundle_parse(flags: &mut Flags, matches: &clap::ArgMatches) {

watch_arg_parse(flags, matches, false);

no_clear_screen_arg_parse(flags, matches);
Copy link
Member

Choose a reason for hiding this comment

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

Maybe merge this function with watch_arg_parse?

Comment on lines +4525 to +4518
#[test]
fn test_watch_with_no_clear_screen() {
Copy link
Member

Choose a reason for hiding this comment

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

Looks good 👍 please add a test case that uses --no-clear-screen but doesn't use --watch and assert that it returns error

cli/main.rs Outdated

tools::lint::lint(maybe_lint_config, lint_flags, flags.watch.is_some())
.await?;
tools::lint::lint(lint_flags, flags).await?;
Copy link
Member

Choose a reason for hiding this comment

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

Please flip order of the arguments (flags, lint_flags)

lint_flags: LintFlags,
watch: bool,
) -> Result<(), AnyError> {
pub async fn lint(lint_flags: LintFlags, flags: Flags) -> Result<(), AnyError> {
Copy link
Member

Choose a reason for hiding this comment

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

Ditto

@ah-yu
Copy link
Contributor Author

ah-yu commented Jan 24, 2022

@bartlomieju Update

@ah-yu ah-yu force-pushed the feat/watch branch 2 times, most recently from 9a58145 to 5705384 Compare January 24, 2022 05:12
@ah-yu ah-yu marked this pull request as draft January 24, 2022 05:29
@ah-yu ah-yu marked this pull request as ready for review January 24, 2022 05:29
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM, @dsherret PTAL too

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM, thank you @ah-yu

@bartlomieju bartlomieju merged commit 5490cfe into denoland:main Jan 31, 2022
@ah-yu ah-yu deleted the feat/watch branch February 1, 2022 00:40
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.

cli: console clearing when watching should be an option
2 participants