Skip to content

Conversation

@kianmeng
Copy link

@kianmeng kianmeng commented Nov 12, 2025

Found via codespell -S *.json,*.lock,tests_data -L hve,afterall and typos --hidden --format brief

Found via `codespe -S *.json,*.lock,tests_data -L hve,afterall` and `typos
--hidden --format brief`
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request fixes a number of typos across the codebase. The changes are mostly correct. I've found a couple of minor issues:

  • In python/scripts/test_magika_model.py, a typo was fixed but replaced with another incorrect word. I've suggested a fix.
  • In python/CHANGELOG.md, the numbering of a list is inconsistent, which I've pointed out for better readability.

Overall, good catch on the typos!

```

1. **CLI Output Format Change (v0.6.0):** The JSON output format of the CLI has changed. Those changes are analogous to the changes to the Python APIs. The `score` field is now at the top level, alongside `dl` and `output`, and is no longer nested within `dl` or `output`. The output also includes `is_text` and `extensions` fields. The `magic` metadata has been removed as it was often either incorrect or reduntant; use `description` instead. Moreover, similarly to what happens under the hood with the `StatusOr` pattern, `result.status` indicates whether the prediction was successful, and the prediction results are available under the `result.value` key.
1. **CLI Output Format Change (v0.6.0):** The JSON output format of the CLI has changed. Those changes are analogous to the changes to the Python APIs. The `score` field is now at the top level, alongside `dl` and `output`, and is no longer nested within `dl` or `output`. The output also includes `is_text` and `extensions` fields. The `magic` metadata has been removed as it was often either incorrect or redundant; use `description` instead. Moreover, similarly to what happens under the hood with the `StatusOr` pattern, `result.status` indicates whether the prediction was successful, and the prediction results are available under the `result.value` key.
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While this PR fixes a typo, I noticed that the numbered list items in the 'Breaking Changes and Migration Guide' section all start with 1.. For better readability of the raw markdown file, it would be clearer to number them sequentially. This item should be 2., and subsequent items in this list should be numbered 3., 4., and so on.

Suggested change
1. **CLI Output Format Change (v0.6.0):** The JSON output format of the CLI has changed. Those changes are analogous to the changes to the Python APIs. The `score` field is now at the top level, alongside `dl` and `output`, and is no longer nested within `dl` or `output`. The output also includes `is_text` and `extensions` fields. The `magic` metadata has been removed as it was often either incorrect or redundant; use `description` instead. Moreover, similarly to what happens under the hood with the `StatusOr` pattern, `result.status` indicates whether the prediction was successful, and the prediction results are available under the `result.value` key.
2. **CLI Output Format Change (v0.6.0):** The JSON output format of the CLI has changed. Those changes are analogous to the changes to the Python APIs. The `score` field is now at the top level, alongside `dl` and `output`, and is no longer nested within `dl` or `output`. The output also includes `is_text` and `extensions` fields. The `magic` metadata has been removed as it was often either incorrect or redundant; use `description` instead. Moreover, similarly to what happens under the hood with the `StatusOr` pattern, `result.status` indicates whether the prediction was successful, and the prediction results are available under the `result.value` key.

Comment on lines +62 to 68
predicated_content_type = mr.prediction.output.label
expected_content_type = test_path.parent.name
if prediceted_content_type != expected_content_type:
if predicated_content_type != expected_content_type:
with_error = True
log_error(
f'{test_path} predicted as "{prediceted_content_type}" (score: {mr.prediction.score:.4f}), expected "{expected_content_type}".'
f'{test_path} predicted as "{predicated_content_type}" (score: {mr.prediction.score:.4f}), expected "{expected_content_type}".'
)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This fixes one typo (prediceted), but introduces another. The correct spelling is predicted, not predicated. 'Predicated' means 'based on', while 'predicted' refers to a future outcome, which is what the model does.

Suggested change
predicated_content_type = mr.prediction.output.label
expected_content_type = test_path.parent.name
if prediceted_content_type != expected_content_type:
if predicated_content_type != expected_content_type:
with_error = True
log_error(
f'{test_path} predicted as "{prediceted_content_type}" (score: {mr.prediction.score:.4f}), expected "{expected_content_type}".'
f'{test_path} predicted as "{predicated_content_type}" (score: {mr.prediction.score:.4f}), expected "{expected_content_type}".'
)
predicted_content_type = mr.prediction.output.label
expected_content_type = test_path.parent.name
if predicted_content_type != expected_content_type:
with_error = True
log_error(
f'{test_path} predicted as "{predicted_content_type}" (score: {mr.prediction.score:.4f}), expected "{expected_content_type}".'
)

@reyammer
Copy link
Collaborator

Thanks! This touches many files, and I'll first need to update the versioning of the packages as well. I'll get to it.

BTW, is the git diff coming from just using those tools above automatically, or you used the tools and then you manually checked what were reasonable findings? I'm wondering whether we could add these commands as part of our CI...

@kianmeng
Copy link
Author

Thanks! This touches many files, and I'll first need to update the versioning of the packages as well. I'll get to it.

Noted.

BTW, is the git diff coming from just using those tools above automatically, or you used the tools and then you manually checked what were reasonable findings? I'm wondering whether we could add these commands as part of our CI...

Manually check one by one, as suggested by the tools. Corrections were applied based on my understanding of the context or intended usage of the doc/code.

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.

2 participants