Skip to content

Commit 20680fe

Browse files
[autofix.ci] apply automated fixes
1 parent 77685fa commit 20680fe

6 files changed

Lines changed: 10 additions & 37 deletions

File tree

crates/forge_api/src/forge_api.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ use forge_app::dto::ToolsOverview;
77
use forge_app::{
88
AgentProviderResolver, AgentRegistry, AppConfigService, AuthService, CommandInfra,
99
CommandLoaderService, ConversationService, DataGenerationApp, EnvironmentInfra,
10-
FileDiscoveryService, ForgeApp, GitApp, GrpcInfra, McpConfigManager, McpService,
11-
PolicyService, ProviderAuthService, ProviderService, Services, User, UserUsage, Walker,
12-
WorkspaceService,
10+
FileDiscoveryService, ForgeApp, GitApp, GrpcInfra, McpConfigManager, McpService, PolicyService,
11+
ProviderAuthService, ProviderService, Services, User, UserUsage, Walker, WorkspaceService,
1312
};
1413
use forge_config::ForgeConfig;
1514
use forge_domain::{Agent, ConsoleWriter, *};

crates/forge_domain/src/mcp.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,7 @@ use serde::{Deserialize, Serialize};
1313
/// Which `.mcp.json` declared a server: the user-level file (global to the
1414
/// machine) or the project-local one.
1515
#[derive(
16-
Debug,
17-
Clone,
18-
Copy,
19-
PartialEq,
20-
Eq,
21-
PartialOrd,
22-
Ord,
23-
Hash,
24-
Serialize,
25-
Deserialize,
26-
JsonSchema,
16+
Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, JsonSchema,
2717
)]
2818
#[serde(rename_all = "lowercase")]
2919
pub enum Scope {

crates/forge_domain/src/policies/engine.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,7 @@ mod tests {
250250
// A `scope: user` rule must not affect a Local-scope operation.
251251
let fixture_workflow = PolicyConfig::new().add_policy(Policy::Simple {
252252
permission: Permission::Allow,
253-
rule: Rule::Mcp(McpRule {
254-
mcp: "*".to_string(),
255-
scope: Some(Scope::User),
256-
dir: None,
257-
}),
253+
rule: Rule::Mcp(McpRule { mcp: "*".to_string(), scope: Some(Scope::User), dir: None }),
258254
});
259255
let fixture = PolicyEngine::new(&fixture_workflow);
260256
let operation = PermissionOperation::Mcp {

crates/forge_services/src/forge_services.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,8 @@ use crate::tool_services::{
3030
ForgeFsUndo, ForgeFsWrite, ForgeImageRead, ForgePlanCreate, ForgeShell, ForgeSkillFetch,
3131
};
3232

33-
type McpService<F> = ForgeMcpService<
34-
ForgeMcpManager<F>,
35-
F,
36-
<F as McpServerInfra>::Client,
37-
ForgePolicyService<F>,
38-
>;
33+
type McpService<F> =
34+
ForgeMcpService<ForgeMcpManager<F>, F, <F as McpServerInfra>::Client, ForgePolicyService<F>>;
3935
type AuthService<F> = ForgeAuthService<F>;
4036

4137
/// ForgeApp is the main application container that implements the App trait.

crates/forge_services/src/mcp/service.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,7 @@ where
220220
authorized.insert(name.clone());
221221
}
222222
Ok(_) => {
223-
denied
224-
.push((name.clone(), "Connection denied by user policy".to_string()));
223+
denied.push((name.clone(), "Connection denied by user policy".to_string()));
225224
}
226225
Err(err) => {
227226
denied.push((name.clone(), format!("Policy check failed: {err:?}")));
@@ -477,18 +476,14 @@ mod tests {
477476
Ok(PolicyDecision { allowed: true, path: None })
478477
}
479478

480-
async fn allow_operation(
481-
&self,
482-
_operation: &PermissionOperation,
483-
) -> anyhow::Result<()> {
479+
async fn allow_operation(&self, _operation: &PermissionOperation) -> anyhow::Result<()> {
484480
Ok(())
485481
}
486482
}
487483

488484
// ── Fixture ──────────────────────────────────────────────────────────────
489485

490-
fn fixture()
491-
-> ForgeMcpService<MockMcpManager, MockInfra, MockMcpClient, AlwaysAllowPolicy> {
486+
fn fixture() -> ForgeMcpService<MockMcpManager, MockInfra, MockMcpClient, AlwaysAllowPolicy> {
492487
ForgeMcpService::new(
493488
Arc::new(MockMcpManager),
494489
Arc::new(MockInfra),

crates/forge_services/src/policy.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,7 @@ where
164164
+ UserInfra,
165165
{
166166
/// Unconditionally persist an allow policy for the given operation.
167-
async fn allow_operation(
168-
&self,
169-
operation: &PermissionOperation,
170-
) -> anyhow::Result<()> {
167+
async fn allow_operation(&self, operation: &PermissionOperation) -> anyhow::Result<()> {
171168
self.add_policy_for_operation(operation).await?;
172169
Ok(())
173170
}

0 commit comments

Comments
 (0)