Skip to content

Commit 450ae43

Browse files
authored
Merge pull request #113 from ulgens/enable-ruff-formatter-ci
Enable ruff formatter in CI
2 parents 274de2d + e774478 commit 450ae43

File tree

12 files changed

+17
-25
lines changed

12 files changed

+17
-25
lines changed

.github/workflows/test-and-lint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
- name: Lint with Ruff
4848
run: |
4949
uv run ruff check src/typesense
50+
uv run ruff format src/typesense
5051
5152
- name: Check types with mypy
5253
run: |

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,3 @@ Bug reports and pull requests are welcome on GitHub at [https://github.com/types
3737
## License
3838

3939
`typesense-python` is distributed under the Apache 2 license.
40-
41-
42-

src/typesense/analytics_events.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,3 @@ def status(self) -> AnalyticsStatus:
6969
entity_type=AnalyticsStatus,
7070
)
7171
return response
72-
73-

src/typesense/analytics_v1.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,3 @@ def __init__(self, api_call: ApiCall) -> None:
4747
@property
4848
def rules(self) -> AnalyticsRulesV1:
4949
return self._rules
50-
51-

src/typesense/collections.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ def __contains__(self, collection_name: str) -> bool:
7272
"""
7373
if collection_name in self.collections:
7474
try: # noqa: WPS229, WPS529
75-
7675
self.collections[collection_name].retrieve() # noqa: WPS529
7776
return True
7877
except Exception:
@@ -100,7 +99,7 @@ def __getitem__(self, collection_name: str) -> Collection[TDoc]:
10099
101100
Example:
102101
>>> collections = Collections(api_call)
103-
>>> fruits_collection = collections['fruits']
102+
>>> fruits_collection = collections["fruits"]
104103
"""
105104
if not self.collections.get(collection_name):
106105
self.collections[collection_name] = Collection(
@@ -126,11 +125,11 @@ def create(self, schema: CollectionCreateSchema) -> CollectionSchema:
126125
>>> schema = {
127126
... "name": "companies",
128127
... "fields": [
129-
... {"name": "company_name", "type": "string" },
130-
... {"name": "num_employees", "type": "int32" },
131-
... {"name": "country", "type": "string", "facet": True }
128+
... {"name": "company_name", "type": "string"},
129+
... {"name": "num_employees", "type": "int32"},
130+
... {"name": "country", "type": "string", "facet": True},
132131
... ],
133-
... "default_sorting_field": "num_employees"
132+
... "default_sorting_field": "num_employees",
134133
... }
135134
>>> created_schema = collections.create(schema)
136135
"""
@@ -154,7 +153,7 @@ def retrieve(self) -> typing.List[CollectionSchema]:
154153
>>> collections = Collections(api_call)
155154
>>> all_collections = collections.retrieve()
156155
>>> for collection in all_collections:
157-
... print(collection['name'])
156+
... print(collection["name"])
158157
"""
159158
call: typing.List[CollectionSchema] = self.api_call.get(
160159
endpoint=Collections.resource_path,

src/typesense/configuration.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,9 @@ def __init__(
223223
)
224224
self.verify = config_dict.get("verify", True)
225225
self.additional_headers = config_dict.get("additional_headers", {})
226-
self.suppress_deprecation_warnings = config_dict.get("suppress_deprecation_warnings", False)
226+
self.suppress_deprecation_warnings = config_dict.get(
227+
"suppress_deprecation_warnings", False
228+
)
227229

228230
def _handle_nearest_node(
229231
self,

src/typesense/overrides.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ class Overrides:
6363

6464
resource_path: typing.Final[str] = "overrides"
6565

66-
@warn_deprecation( # type: ignore[misc]
66+
@warn_deprecation( # type: ignore[misc]
6767
"Overrides is deprecated on v30+. Use client.curation_sets instead.",
6868
flag_name="overrides_deprecation",
6969
)
7070
def __init__(
7171
self,
7272
api_call: ApiCall,
7373
collection_name: str,
74-
) -> None:
74+
) -> None:
7575
"""
7676
Initialize the Overrides object.
7777

src/typesense/synonyms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ class Synonyms:
6161

6262
resource_path: typing.Final[str] = "synonyms"
6363

64-
@warn_deprecation( # type: ignore[misc]
64+
@warn_deprecation( # type: ignore[misc]
6565
"The synonyms API (collections/{collection}/synonyms) is deprecated is removed on v30+. "
6666
"Use synonym sets (synonym_sets) instead.",
6767
flag_name="synonyms_deprecation",
6868
)
69-
def __init__(self, api_call: ApiCall, collection_name: str) -> None:
69+
def __init__(self, api_call: ApiCall, collection_name: str) -> None:
7070
"""
7171
Initialize the Synonyms object.
7272

src/typesense/types/analytics_rule_v1.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,5 +201,3 @@ class RulesRetrieveSchema(typing.TypedDict):
201201
"""
202202

203203
rules: typing.List[typing.Union[RuleSchemaForQueries, RuleSchemaForCounters]]
204-
205-

src/typesense/types/collection.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,4 +236,3 @@ class CollectionUpdateSchema(typing.TypedDict):
236236
]
237237
synonym_sets: typing.NotRequired[typing.List[str]]
238238
curation_sets: typing.NotRequired[typing.List[str]]
239-

0 commit comments

Comments
 (0)