Method Signature Change Risk
Detects breaking method signature changes: removed parameters, new required parameters without defaults, or return type changes in public methods.
Why this rule exists
Public method signatures are contracts. Removing a parameter, adding a required one, or changing the return type breaks every caller. These changes demand deprecation cycles, not silent breaking changes.
Code example
- public Task<User> GetUser(int id) { }
+ public Task<User> GetUser(Guid id) { }
+ // OR
- public void ProcessOrder(Order order) { }
+ public void ProcessOrder(Order order, ProcessOptions options) { } // no default [Obsolete("Use GetUserAsync(Guid)")]
public Task<User> GetUser(int id) => GetUserAsync(new Guid(id.ToString()));
+ public Task<User> GetUserAsync(Guid id) { }
+ // OR
+ public void ProcessOrder(Order order, ProcessOptions options = null) { } // default providedConfiguration
Disable or adjust the severity of this rule in .gauntletci.json:
{
"rules": {
"GCI0055": { "enabled": true, "severity": "Block" }
}
}See Configuration for the full schema.
Related rules
Implemented in src/GauntletCI.Core/Rules/Implementations/GCI0055_*.cs.
Eric Cogen -- Founder, GauntletCI
Twenty years in .NET production. Most of those years, the bugs that hurt me were not the ones tests caught. They were the assumptions I did not know I was making: a removed guard clause, a renamed method that still did the old thing, a catch {} that turned a page into a silent dashboard lie. GauntletCI is the checklist I wish I had run before every commit. It runs the rules I learned the hard way, so you do not have to.
