Skip to content

Navigation Menu

Sign in
Sign up

Fix double negatives on bool opts with underscores - #551

Open
tommarshall wants to merge 1 commit into
rails:main from
tommarshall:fix-double-negative-bool-opts-with-underscores
Open

Fix double negatives on bool opts with underscores #551
tommarshall wants to merge 1 commit into
rails:main from
tommarshall:fix-double-negative-bool-opts-with-underscores

Conversation

@tommarshall

@tommarshall tommarshall commented Mar 7, 2017

Copy link
Copy Markdown

Because:

  • Negative options #460 (released in 0.19.2) introduced a change that prevents double negative options (--no-no-foo) for already negative boolean options (--no-foo).
  • That change checks if the option name string starts with 'no-', before it's dasherized, therefore negative options defined with underscores (:no_foo) still generate a double negative --no-no-foo option.

This change:

  • Adds a test for, and fixes the double negative boolean options
    defined with underscores.

Because:
* rails#460 (released in `0.19.2`)
 introduced a change that prevents double negative options
 (`--no-no-foo`) for already negative boolean options (`--no-foo`).
* That change checks if the option name string starts with 'no-', before
 it's `dasherized`, therefore negative options defined with underscores
 (`:no_foo`) still generate a double negative `--no-no-foo` option.
This change:
* Adds a test for, and fixes the double negative boolean options
 defined with underscores.

Copy link
Copy Markdown

This is related to #553 in as far as negation of boolean flags is concerned. I feel as though this automatic negation provides more obscure behaviour than real benefits. Your fix kind of demonstrates the possible corner cases etc.... I'm not sure if this should be merged or the behaviour of actual negation changed. Teetering towards the later.

joe-edmonds and tristanmorgan reacted with thumbs up emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /