Skip to content

Add :snake_number - #39

Draft
AS1100K wants to merge 2 commits into
masterfrom
feat/snake_number
Draft

Add :snake_number#39
AS1100K wants to merge 2 commits into
masterfrom
feat/snake_number

Conversation

@AS1100K

@AS1100K AS1100K commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Fixes #38

@AS1100K AS1100K added the enhancement New feature or request label Jul 1, 2026
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new :snake_number modifier to the pastey segment modifier pipeline to produce snake_case output that separates embedded numbers (e.g., ThisIsButA1Testthis_is_but_a_1_test), addressing feature request #38.

Changes:

  • Extend the :snake modifier logic to support a new :snake_number variant that can underscore before numeric runs.
  • Add test coverage for :snake_number (including :lower/:upper) in the test suite.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/segment.rs Adds snake_number handling to snake-case conversion logic.
pastey-test-suite/tests/test_item.rs Adds tests validating snake_number output (and lower/upper variants).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +156 to +164
m!(ThisIsButA1Test);

#[test]
fn test_to_snake_number() {
assert_eq!(DEFAULT_SNAKE_NUMBER, "this_is_but_a_1_test");
assert_eq!(LOWER_SNAKE_NUMBER, "this_is_but_a_1_test");
assert_eq!(UPPER_SNAKE_NUMBER, "THIS_IS_BUT_A_1_TEST");
}
}
Comment thread src/segment.rs
Comment on lines +216 to +217
let should_trigger_underscore =
ch.is_uppercase() || (include_numbers && ch.is_numeric());
@AS1100K
AS1100K marked this pull request as draft July 1, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Add :snake_number

2 participants