Skip to content

Commit b30b80e

Browse files
committed
formatting
1 parent 3adad5e commit b30b80e

File tree

7 files changed

+33
-35
lines changed

7 files changed

+33
-35
lines changed

crates/chat-cli/src/cli/chat/cli/context.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use crossterm::{
1111
};
1212

1313
use crate::cli::chat::consts::AGENT_FORMAT_HOOKS_DOC_URL;
14-
use crate::constants::help_text::{CONTEXT_DESCRIPTION, context_long_help};
1514
use crate::cli::chat::context::{
1615
ContextFilePath,
1716
calc_max_context_files_size,
@@ -23,7 +22,10 @@ use crate::cli::chat::{
2322
ChatSession,
2423
ChatState,
2524
};
26-
25+
use crate::constants::help_text::{
26+
CONTEXT_DESCRIPTION,
27+
context_long_help,
28+
};
2729
use crate::os::Os;
2830

2931
#[deny(missing_docs)]

crates/chat-cli/src/cli/chat/cli/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@ use crate::cli::chat::{
4949
ChatSession,
5050
ChatState,
5151
};
52-
use crate::constants::ui_text::EXTRA_HELP;
5352
use crate::cli::issue;
54-
53+
use crate::constants::ui_text::EXTRA_HELP;
5554
use crate::os::Os;
5655

5756
/// q (Amazon Q Chat)

crates/chat-cli/src/cli/chat/mod.rs

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ mod prompt;
1313
mod prompt_parser;
1414
pub mod server_messenger;
1515
use crate::cli::chat::checkpoint::CHECKPOINT_MESSAGE_MAX_LENGTH;
16-
use crate::constants::ui_text::{LIMIT_REACHED_TEXT, WELCOME_TEXT, RESUME_TEXT, SMALL_SCREEN_WELCOME, POPULAR_SHORTCUTS, SMALL_SCREEN_POPULAR_SHORTCUTS};
16+
use crate::constants::ui_text::{
17+
LIMIT_REACHED_TEXT,
18+
POPULAR_SHORTCUTS,
19+
RESUME_TEXT,
20+
SMALL_SCREEN_POPULAR_SHORTCUTS,
21+
SMALL_SCREEN_WELCOME,
22+
WELCOME_TEXT,
23+
};
1724
#[cfg(unix)]
1825
mod skim_integration;
1926
mod token_counter;
@@ -145,11 +152,6 @@ use crate::api_client::{
145152
use crate::auth::AuthError;
146153
use crate::auth::builder_id::is_idc_user;
147154
use crate::cli::TodoListState;
148-
use crate::constants::{
149-
error_messages,
150-
tips,
151-
ui_text,
152-
};
153155
use crate::cli::agent::Agents;
154156
use crate::cli::chat::checkpoint::{
155157
CheckpointManager,
@@ -167,6 +169,11 @@ use crate::cli::experiment::experiment_manager::{
167169
ExperimentManager,
168170
ExperimentName,
169171
};
172+
use crate::constants::{
173+
error_messages,
174+
tips,
175+
ui_text,
176+
};
170177
use crate::database::settings::Setting;
171178
use crate::os::Os;
172179
use crate::telemetry::core::{
@@ -436,8 +443,6 @@ impl ChatArgs {
436443
}
437444
}
438445

439-
440-
441446
// Maximum number of times to show the changelog announcement per version
442447
const CHANGELOG_MAX_SHOW_COUNT: i64 = 2;
443448

@@ -446,8 +451,6 @@ const ROTATING_TIPS: [&str; 20] = tips::ROTATING_TIPS;
446451

447452
const GREETING_BREAK_POINT: usize = 80;
448453

449-
450-
451454
const RESPONSE_TIMEOUT_CONTENT: &str = "Response timed out - message took too long to generate";
452455
fn trust_all_text() -> String {
453456
ui_text::trust_all_warning()
@@ -1018,17 +1021,9 @@ impl ChatSession {
10181021

10191022
return Ok(());
10201023
},
1021-
_ => (
1022-
error_messages::TROUBLE_RESPONDING,
1023-
Report::from(err),
1024-
true,
1025-
),
1024+
_ => (error_messages::TROUBLE_RESPONDING, Report::from(err), true),
10261025
},
1027-
_ => (
1028-
error_messages::TROUBLE_RESPONDING,
1029-
Report::from(err),
1030-
true,
1031-
),
1026+
_ => (error_messages::TROUBLE_RESPONDING, Report::from(err), true),
10321027
};
10331028

10341029
if display_err_message {
@@ -1254,7 +1249,8 @@ impl ChatSession {
12541249
queue!(
12551250
self.stderr,
12561251
style::Print(format!(
1257-
"{}{}\n\n", trust_all_text(),
1252+
"{}{}\n\n",
1253+
trust_all_text(),
12581254
if !is_small_screen { "\n" } else { "" }
12591255
))
12601256
)?;

crates/chat-cli/src/cli/user.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ use crate::auth::builder_id::{
3737
start_device_authorization,
3838
};
3939
use crate::auth::pkce::start_pkce_authorization;
40+
use crate::constants::PRODUCT_NAME;
4041
use crate::os::Os;
4142
use crate::telemetry::{
4243
QProfileSwitchIntent,
@@ -47,7 +48,6 @@ use crate::util::spinner::{
4748
SpinnerComponent,
4849
};
4950
use crate::util::system_info::is_remote;
50-
use crate::constants::PRODUCT_NAME;
5151
use crate::util::{
5252
CLI_BINARY_NAME,
5353
choose,

crates/chat-cli/src/constants.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,20 @@ pub mod ui_text {
2222

2323
/// Changelog header text
2424
pub fn changelog_header() -> String {
25-
format!("{}", color_print::cstr! {"<magenta,bold>What's New in Amazon Q CLI</magenta,bold>\n\n"})
25+
format!(
26+
"{}",
27+
color_print::cstr! {"<magenta,bold>What's New in Amazon Q CLI</magenta,bold>\n\n"}
28+
)
2629
}
2730

28-
2931
/// Trust all tools warning text
3032
pub fn trust_all_warning() -> String {
31-
format!("{}", color_print::cstr! {"<green!>All tools are now trusted (<red!>!</red!>). Amazon Q will execute tools <bold>without</bold> asking for confirmation.\
33+
format!(
34+
"{}",
35+
color_print::cstr! {"<green!>All tools are now trusted (<red!>!</red!>). Amazon Q will execute tools <bold>without</bold> asking for confirmation.\
3236
\nAgents can sometimes do unexpected things so understand the risks.</green!>
33-
\nLearn more at https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-chat-security.html#command-line-chat-trustall-safety"})
37+
\nLearn more at https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-chat-security.html#command-line-chat-trustall-safety"}
38+
)
3439
}
3540

3641
/// Rate limit reached message

crates/chat-cli/src/util/consts.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
pub const CLI_BINARY_NAME: &str = "q";
33
pub const CHAT_BINARY_NAME: &str = "qchat";
44

5-
65
pub const GITHUB_REPO_NAME: &str = "aws/amazon-q-developer-cli";
76

87
pub const MCP_SERVER_TOOL_DELIMITER: &str = "/";

crates/chat-cli/src/util/ui.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ pub fn render_changelog_content(output: &mut impl Write) -> Result<()> {
2222
execute!(output, style::Print("\n"))?;
2323

2424
// Title
25-
execute!(
26-
output,
27-
style::Print(ui_text::changelog_header()),
28-
)?;
25+
execute!(output, style::Print(ui_text::changelog_header()),)?;
2926

3027
// Render recent entries
3128
for entry in recent_entries {

0 commit comments

Comments
 (0)