Skip to content

Commit a97247c

Browse files
committed
Fix many lint issues
1 parent 7dcea78 commit a97247c

File tree

4 files changed

+22
-5
lines changed

4 files changed

+22
-5
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
fail_fast: true
2+
13
# See https://pre-commit.com for more information
24
# See https://pre-commit.com/hooks.html for more hooks
35

README.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ Getting Started
2222

2323
.. code-block:: python
2424
25+
"""Add a target to VWS and then query it."""
26+
2527
import pathlib
28+
import uuid
2629
2730
from vws import VWS, CloudRecoService
2831
@@ -39,7 +42,8 @@ Getting Started
3942
client_access_key=client_access_key,
4043
client_secret_key=client_secret_key,
4144
)
42-
name = "my_image_name"
45+
46+
name = "my_image_name_" + uuid.uuid4().hex
4347
4448
image = pathlib.Path("high_quality_image.jpg")
4549
with image.open(mode="rb") as my_image_file:
@@ -54,6 +58,7 @@ Getting Started
5458
matching_targets = cloud_reco_client.query(image=my_image_file)
5559
5660
assert matching_targets[0].target_id == target_id
61+
a = 1
5762
5863
Full Documentation
5964
------------------

docs/source/index.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ See the :doc:`api-reference` for full usage details.
1818

1919
.. code-block:: python
2020
21+
"""Add a target to VWS and then query it."""
22+
2123
import pathlib
24+
import uuid
2225
2326
from vws import VWS, CloudRecoService
2427
@@ -35,9 +38,8 @@ See the :doc:`api-reference` for full usage details.
3538
client_access_key=client_access_key,
3639
client_secret_key=client_secret_key,
3740
)
38-
import uuid
3941
40-
name = "my_image_name" + uuid.uuid4().hex
42+
name = "my_image_name_" + uuid.uuid4().hex
4143
4244
image = pathlib.Path("high_quality_image.jpg")
4345
with image.open(mode="rb") as my_image_file:
@@ -67,11 +69,14 @@ To write unit tests for code which uses this library, without using your Vuforia
6769
6870
.. code-block:: python
6971
72+
"""Test adding a target to VWS."""
73+
7074
import pathlib
7175
72-
from mock_vws.database import VuforiaDatabase
7376
from mock_vws import MockVWS
74-
from vws import CloudRecoService, VWS
77+
from mock_vws.database import VuforiaDatabase
78+
79+
from vws import VWS, CloudRecoService
7580
7681
with MockVWS() as mock:
7782
database = VuforiaDatabase()

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ lint.per-file-ignores."conftest.py" = [
123123
"S106",
124124
]
125125

126+
lint.per-file-ignores."doccmd_*.py" = [
127+
# Allow hardcoded secrets in documentation.
128+
"S105",
129+
]
130+
126131
lint.per-file-ignores."tests/*.py" = [
127132
# Do not require tests to have a one-line summary.
128133
"D205",

0 commit comments

Comments
 (0)