Skip to content

Fix a redundant regexp escape in the tool name validation - #553

Merged
koic merged 1 commit into
modelcontextprotocol:mainfrom
koic:suppress_rubocop_offense
Sep 15, 2026
Merged

koic merged 1 commit into
modelcontextprotocol:mainfrom
koic:suppress_rubocop_offense

Conversation

@koic

@koic koic commented Sep 15, 2026

Copy link
Copy Markdown
Member

Motivation and Context

This PR suppresses the following offense of RuboCop.

$ bundle exec rubocop
Inspecting 163 files
(snip)

Offenses:

lib/mcp/tool.rb:152:48: C: [Correctable] Style/RedundantRegexpEscape: Redundant escape inside regexp literal
        unless tool_name.match?(/\A[A-Za-z\d_\-\.]+\z/)
                                               ^^

163 files inspected, 1 offense detected, 1 offense autocorrectable

How Has This Been Tested?

bundle exec rake passes: RuboCop reports no offenses.

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

## Motivation and Context

This PR suppresses the following offense of RuboCop.

```console
$ bundle exec rubocop
Inspecting 163 files
(snip)

Offenses:

lib/mcp/tool.rb:152:48: C: [Correctable] Style/RedundantRegexpEscape: Redundant escape inside regexp literal
        unless tool_name.match?(/\A[A-Za-z\d_\-\.]+\z/)
                                               ^^

163 files inspected, 1 offense detected, 1 offense autocorrectable
```

## How Has This Been Tested?

`bundle exec rake` passes: RuboCop reports no offenses.

## Breaking Changes

None.
@koic
koic merged commit 41fbf05 into modelcontextprotocol:main Sep 15, 2026
11 checks passed
@koic
koic deleted the suppress_rubocop_offense branch September 15, 2026 15:44
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.

1 participant