BLD: add more static analysis#31661
Open
tacaswell wants to merge 17 commits into
Open
Conversation
These were false positives, but add code to give the analyzer a hint + asserts in a debugging build rather than NOLINT to be defensive. Aided by 🤖
When for no-change to code with the qhull wrapper rather than adjusting the code. Aided by 🤖
Fixes an issue found by clang-tidy Aided by 🤖
Added exceptions for things it thinks are questionable but we are OK with doing. Aided by 🤖
Aided by 🤖
Aided by 🤖
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
debugged with my own brain
QuLogic
reviewed
May 12, 2026
| @@ -0,0 +1,246 @@ | |||
| #!/usr/bin/env python3 | |||
| """ | |||
| Run clang-tidy on Matplotlib's C/C++ and Objective-C sources. | |||
Member
There was a problem hiding this comment.
I'm not sure this script is fully necessary; meson will create a clang-tidy target for you (but only if you have .clang-tidy in the root), so you just need to move it, make an editable install, and run ninja -C build/cp313 clang-tidy or similar
| hooks: | ||
| - id: yamllint | ||
| args: ["--strict", "--config-file=.yamllint.yml"] | ||
| - repo: https://github.com/nbQA-dev/nbQA |
Member
There was a problem hiding this comment.
I'm confused why this is needed; https://github.com/astral-sh/ruff-pre-commit has a note on how not to run on notebooks, so I thought it's enabled by default.
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.
PR summary
This adds more static analysis to our CI / prek config.
clang-tidyon c/c++/objectiveC code (and fix or ignore issues found). This found a couple of real issues and will only run on CI (+ a helper script to run it locally). The dependencies are too heavy to try and launder through prek's virtual environments.pull_request_targetand a couple of places we allow caching. Also enabled cooldown windows on our dependabot config. This also flagged we had a redundant checkout step inNot reflected in the commits here, but I did look at https://github.com/PyCQA/bandit but every single thing it flagged was a false positive (either flagging things like
execin the plot directive or being too simplistic to notice that we had already mitigated the thing it was flagging in the code).AI Disclosure
I started from the prompt
with opus 4.6 and then pushing on addressing the coverage with a mix of opus 4.6 and sonnet 4.6. I reviewed everything as I committed it and took a very heavy editing pass at the initial version of the documentation.
PR checklist