Skip to content

fix: add missing arguments to format calls - #14517

Merged
kgryte merged 2 commits into
developfrom
philipp/fix-format-args
Aug 22, 2026
Merged

kgryte merged 2 commits into
developfrom
philipp/fix-format-args

Conversation

@Planeshifter

@Planeshifter Planeshifter commented Aug 22, 2026 •

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • fixes a format call in ndarray/count-if in which the format string expects three arguments (%s, %d, %s), but only two were provided, resulting in a malformed error message (the option name was omitted and subsequent arguments shifted).
  • fixes a format call in stats/binomial-test in which the format string expects two arguments (%u, %u), but none were provided, resulting in an error message with uninterpolated placeholders.

Related Issues

Does this pull request have any related issues?

No.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

These bugs were discovered while developing an ESLint rule which verifies that string/format calls are provided an expected number of arguments (proposed in #14518).

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

This PR was written by Claude Code under my direction and instructions; the bugs were detected via a prototype of the lint rule proposed in #14518.


@stdlib-js/reviewers

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown_pkg_readmes
    status: na
  - task: lint_markdown_docs
    status: na
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown_pkg_readmes
    status: na
  - task: lint_markdown_docs
    status: na
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@Planeshifter
Planeshifter marked this pull request as ready for review August 22, 2026 05:40
@Planeshifter
Planeshifter requested review from a team and kgryte August 22, 2026 05:40
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Aug 22, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
ndarray/count-if $\\color{red}528/530$
$\\color{green}+99.62\\%$
$\\color{red}62/63$
$\\color{green}+98.41\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{red}528/530$
$\\color{green}+99.62\\%$
stats/binomial-test $\\color{red}422/436$
$\\color{green}+96.79\\%$
$\\color{red}73/79$
$\\color{green}+92.41\\%$
$\\color{green}5/5$
$\\color{green}+100.00\\%$
$\\color{red}422/436$
$\\color{green}+96.79\\%$

The above coverage report was generated for the changes in this PR.

@Planeshifter Planeshifter mentioned this pull request Aug 22, 2026
6 of 7 tasks
@kgryte kgryte changed the title fix: add missing arguments to format calls in ndarray/count-if and stats/binomial-test fix: add missing arguments to format calls Aug 22, 2026
@kgryte
kgryte merged commit 668ccdd into develop Aug 22, 2026
39 checks passed
@kgryte
kgryte deleted the philipp/fix-format-args branch August 22, 2026 07:52
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Aug 22, 2026
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.

3 participants