Skip to content

Commit 23f0f01

Browse files
hofbialexeagle
andauthored
chore: Add typos pre-commit hook (#503)
Automated typo fixes --- ### Changes are visible to end-users: yes Typos were mainly fixed in the docs/docstrings --------- Co-authored-by: Alex Eagle <[email protected]>
1 parent 0090277 commit 23f0f01

File tree

14 files changed

+29
-14
lines changed

14 files changed

+29
-14
lines changed

.github/workflows/ci.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ jobs:
5454

5555
test-release:
5656
runs-on: ubuntu-latest
57+
permissions:
58+
pull-requests: write # allow commenting to the PR with the token
5759
defaults:
5860
run:
5961
working-directory: e2e/use_release
@@ -71,6 +73,7 @@ jobs:
7173
# The github-actions-report-lcov doesn't follow symlinks, so get an absolute path
7274
- run: echo "bazel_testlogs=$(bazel info bazel-testlogs)" >> $GITHUB_ENV
7375
- name: Report code coverage
76+
if: github.event.pull_request.head.repo.fork == false # Forks always have read-only tokens
7477
uses: zgosalvez/github-actions-report-lcov@5989987f8058a03137e90bc16f9c0baaac5e069a # v4.1.22
7578
with:
7679
working-directory: ${{ env.bazel_testlogs }}

.pre-commit-config.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,12 @@ repos:
2424
rev: "v3.1.0"
2525
hooks:
2626
- id: prettier
27+
- repo: https://github.com/crate-ci/typos
28+
rev: v1.28.4
29+
hooks:
30+
- id: typos
31+
exclude: |
32+
(?x)^(
33+
examples/django/mysite/settings.py|
34+
gazelle_python.yaml
35+
)

.typos.toml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[default.extend-identifiers]
2+
MODULEs = "MODULEs" # Else it becomes MODULEEs
3+
alocation = "alocation" # Used as 'a location'

docs/py_binary.md

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/py_test.md

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/venv.md

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e/system-interpreter/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Test system interperter
1+
# Test system interpreter
22

33
This is a minimal test that rules_py can use a toolchain that relies on the system interpreter.
44
Note that this is setup to run on Aspect's CI, and locally on a MacOS, paths may vary on your system if running this.

py/private/providers.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ PyWheelInfo = provider(
1111
PyVirtualInfo = provider(
1212
doc = "FIXME",
1313
fields = {
14-
"dependencies": "Depset of required virtual dependencies, independant of their resolution status",
14+
"dependencies": "Depset of required virtual dependencies, independent of their resolution status",
1515
"resolutions": "FIXME",
1616
},
1717
)

py/private/py_binary.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ _attrs = dict({
147147
),
148148
"package_collisions": attr.string(
149149
doc = """The action that should be taken when a symlink collision is encountered when creating the venv.
150-
A collision can occour when multiple packages providing the same file are installed into the venv. The possible values are:
150+
A collision can occur when multiple packages providing the same file are installed into the venv. The possible values are:
151151
152152
* "error": When conflicting symlinks are found, an error is reported and venv creation halts.
153153
* "warning": When conflicting symlinks are found, an warning is reported, however venv creation continues.

py/private/py_venv.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ py_venv_rule = rule(
115115
),
116116
"package_collisions": attr.string(
117117
doc = """The action that should be taken when a symlink collision is encountered when creating the venv.
118-
A collision can occour when multiple packages providing the same file are installed into the venv. The possible values are:
118+
A collision can occur when multiple packages providing the same file are installed into the venv. The possible values are:
119119
120120
* "error": When conflicting symlinks are found, an error is reported and venv creation halts.
121121
* "warning": When conflicting symlinks are found, an warning is reported, however venv creation continues.

py/private/virtual.bzl

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Utility functions around managing virtual dependencies and resoloutions"""
22

3-
_RESOLUTION_SENTINAL_KEY = "_RESOLUTION_SENTINAL"
3+
_RESOLUTION_SENTINEL_KEY = "_RESOLUTION_SENTINEL"
44

55
def _make_resolutions(base, requirement_fn = lambda r: r):
66
"""Returns data representing the resolution for a given set of dependencies
@@ -13,7 +13,7 @@ def _make_resolutions(base, requirement_fn = lambda r: r):
1313
A resolution struct for use with virtual deps.
1414
"""
1515

16-
if not _RESOLUTION_SENTINAL_KEY in base:
16+
if not _RESOLUTION_SENTINEL_KEY in base:
1717
_resolutions = dict([
1818
[
1919
k,
@@ -23,14 +23,14 @@ def _make_resolutions(base, requirement_fn = lambda r: r):
2323
),
2424
]
2525
for k in base.keys()
26-
], **{_RESOLUTION_SENTINAL_KEY: True})
26+
], **{_RESOLUTION_SENTINEL_KEY: True})
2727
else:
2828
_resolutions = base
2929

3030
return struct(
3131
resolutions = _resolutions,
3232
override = lambda overrides, **kwargs: _make_resolutions(_make_overrides(_resolutions, overrides)),
33-
to_label_keyed_dict = lambda: dict({v.requirement: v.name for k, v in _resolutions.items() if k != _RESOLUTION_SENTINAL_KEY}),
33+
to_label_keyed_dict = lambda: dict({v.requirement: v.name for k, v in _resolutions.items() if k != _RESOLUTION_SENTINEL_KEY}),
3434
)
3535

3636
def _make_overrides(resolutions, overrides):

py/tools/pex/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def __call__(self, parser, namespace, value, option_str=None):
120120
INJECT_TEMPLATE.append("sys.path.append(os.path.abspath(os.path.join(__entry_point__, '%s')))" % path)
121121

122122
import_idx = BE.index("from pex.pex_bootstrapper import bootstrap_pex")
123-
# This is here to catch potential future bugs where pex package is updated here but the boostrap
123+
# This is here to catch potential future bugs where pex package is updated here but the bootstrap
124124
# script was not checked again to see if we are still injecting values in the right place.
125125
assert import_idx == 3703, "Check bootstrap template monkey patching."
126126

py/tools/py/src/unpack.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub fn unpack_wheel(version: &str, location: &Path, wheel: &Path) -> Result<()>
4848
let filename = wheel
4949
.file_name()
5050
.and_then(|f| f.to_str())
51-
.expect("Exepected to get filename from wheel path");
51+
.expect("Expected to get filename from wheel path");
5252
let wheel_file_name =
5353
uv_distribution_filename::WheelFilename::from_str(filename).into_diagnostic()?;
5454

py/tools/unpack_bin/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct UnpackArgs {
1616
wheel: PathBuf,
1717

1818
/// Python version, eg 3.8.12
19-
/// Must be seperated by dots.
19+
/// Must be separated by dots.
2020
#[arg(long)]
2121
python_version: String,
2222
}

0 commit comments

Comments
 (0)