Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Spell check (typos)

on:
workflow_dispatch:
push:
branches:
- "main"
pull_request:

permissions:
contents: read

jobs:
typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # pin@v4

- name: Run typos spell checker
uses: crate-ci/typos@631208b7aac2daa8b707f55e7331f9112b0e062d # pin@v1.44.0
32 changes: 32 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Configuration for the typos spell checker.
# See https://github.com/crate-ci/typos

[files]
# Exclude generated, binary, and data files that produce false positives.
extend-exclude = [
"*.json",
"*.lock",
"tests_data/",
"assets/models/",
]

[default.extend-words]
# Domain-specific terms or intentional spellings kept to avoid false positives.

# "hve" appears in ONNX model internals referenced in comments.
hve = "hve"

# "afterall" is used as a variable/identifier name in test scripts.
afterall = "afterall"

# "Hashi" is the first half of "HashiCorp" (vendor name in content type descriptions).
hashi = "hashi"

# "Harc" is the first half of "LHarc" (a legacy archive format name).
harc = "harc"

# "cpy" / "CPY" are standard file extensions for COBOL copybook files.
cpy = "cpy"

# "LICENSEs" is the plural of "LICENSE" (used in dist-workspace.toml comments).
licens = "licens"
2 changes: 1 addition & 1 deletion python/tests/test_magika_python_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def test_magika_module_with_whitespaces() -> None:
)

for ws_num in ws_nums:
print(f"Calling indentify_bytes with {ws_num} whitespaces")
print(f"Calling identify_bytes with {ws_num} whitespaces")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

While fixing the typo is good, using print() in automated tests is generally discouraged as it can clutter test output. If this output is useful for debugging, consider using the logging module, which integrates well with pytest's output capturing. If it was for temporary debugging, it should be removed.

content = b" " * ws_num
res = m.identify_bytes(content)
assert (
Expand Down