-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
tap_auditor: validate pypi_formula_mappings.json #16800
Conversation
Note that |
8601aac
to
254c900
Compare
After adding some bad values to JSON, the audit output looks like: ❯ brew audit --tap homebrew/core --only 'json_files,tap_formula_lists'
homebrew/core
* pypi_formula_mappings.json schema validation failed with following errors:
* object property at `/aiven-client/foo` is not defined and schema does not allow additional properties
* value at `/animdl/exclude_packages/1` is not a string
* pypi_formula_mappings.json references
formulae or casks that are not found in the homebrew/core tap.
Invalid formulae or casks: brew
Error: 2 problems in 1 tap detected. I only created parts of JSON Schema needed to run check, but can choose to fill out the other metadata. I added it to catch things like typos and unwanted empty lists. Can also consider restricting to |
@cho-m love the idea! |
Signed-off-by: Michael Cho <[email protected]>
254c900
to
254355d
Compare
Still fine tuning schema. I plan to update |
"package_name": { | ||
"description": "Normalized PyPI package name with optional extras", | ||
"type": "string", | ||
"pattern": "^[a-z0-9][a-z0-9-]*(\\[[a-z0-9][a-z0-9-]*(,[a-z0-9][a-z0-9-]*)*\\])?$" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a simplification of https://packaging.python.org/en/latest/specifications/name-normalization/. It doesn't handle trailing -
or consecutive -
as those make the regex messier.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?Follow up after #16772 to do schema validation and valid formulae checks.