Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formatter: support non-string-message checks #221

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Antonboom
Copy link
Owner

Closes #201
Closes #202

@@ -134,6 +135,9 @@ func BindToFlags(cfg *Config, fs *flag.FlagSet) {
fs.BoolVar(&cfg.Formatter.RequireFFuncs,
"formatter.require-f-funcs", false,
"to require f-assertions (e.g. assert.Equalf) if format string is used, even if there are no variable-length variables.")
fs.BoolVar(&cfg.Formatter.AllowNonStringMsg,
"formatter.allow-non-string-msg", false,
"to allow non-string value as first element of msgAndArgs assertion's argument")
Copy link

@mmorel-35 mmorel-35 Feb 12, 2025

Choose a reason for hiding this comment

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

Having variable with not or non is by experience not straightforward for the next person reading it.

What do you think of using an affirmative formulation like
formatter.require-string-msg with true value by default ?

@coveralls
Copy link

Pull Request Test Coverage Report for Build 13285179325

Details

  • 56 of 56 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 93.937%

Totals Coverage Status
Change from base Build 13249077456: 0.1%
Covered Lines: 2510
Relevant Lines: 2672

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants