Repository navigation
Add the Policy switches to python -m nameparser - #1114
Merged
Merged
Conversation
--two-given-names, --two-family-names, --middle-as-family,
--lenient-comma-suffixes and --unlisted-dotted-suffixes (each with a
--no- form) and --unlisted-caps-suffixes {off,after-comma,everywhere}
set the Policy field of their name, written into the --locale pack's
own patch as --order is, so each replaces a pack's setting and one
left out keeps it. A test sorts every Policy field into a flag or a
named reason it has none, so a new field must be decided.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…too (#1114) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…er flag The argparse quoting differs only on 3.12 (bare) against 3.11 and 3.13 on (quoted), so AGENTS.md's sentence and the test comment say so and point at matching a message in a form every interpreter writes. --unlisted-caps-suffixes gains a one-line help, the two_family_names help and the delimiter comment say what the fields hold, and the examples contrast the pack (Lic) with the flag. A stand-in pack per flag proves a flag left out keeps the pack's setting and one given wins, for every flag rather than only two_family_names. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lets the command line try a rule on one name, to see whether a
Policyswitch already resolves a parse problem.--two-given-names,--two-family-names,--middle-as-family,--lenient-comma-suffixes,--unlisted-dotted-suffixes, each with a--no-form (argparse.BooleanOptionalAction), and--unlisted-caps-suffixes {off,after-comma,everywhere}, its choices read fromCapsSuffixes.--order, each is written into the--localepack's ownPolicyPatch, so it replaces the pack's setting (--locale es --no-two-family-names) and a flag left out keeps the pack's value.Policyfields stay off the command line on purpose, listed in_NOT_ON_THE_COMMAND_LINE:script_orders,segment_scripts,patronymic_rulesand the three delimiter sets need real setup, andstrip_emoji/strip_bidiare input clean-up.test_cli_sorts_every_policy_field_into_a_flag_or_a_reasonholds the tables todataclasses.fields(Policy), so a new field fails until someone decides.No parser behavior changes, so no rules docs move;
docs/usage.rst's command-line section and the release log gain a paragraph and a bullet.Test plan
_SWITCHES--unlisted-caps-suffixesvalue on a comma name and a trailing-capitals name, with a row-coverage check againstCapsSuffixes--orderPolicydefault fails it for every field that mutation reachesuv run pytest(38,961 passed),uv run mypy,uv run ruff check🤖 Generated with Claude Code