Skip to content

Commit 665566d

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 0b800b4 commit 665566d

File tree

2 files changed

+17
-32
lines changed

2 files changed

+17
-32
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ env = Env()
196196
# A single validator function
197197
NAME = env.str("NAME", validate=lambda n: n.startswith("Harry"))
198198

199+
199200
# A validator function can signal error by raising an exception
200201
def is_positive(num):
201202
if num <= 0:

src/typenv/__init__.py

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,12 @@ def str(
145145
*,
146146
default: type[_Missing] | _Str = _Missing,
147147
validate: Callable | Iterable[Callable] = (),
148-
) -> _Str:
149-
...
148+
) -> _Str: ...
150149

151150
@typing.overload
152151
def str(
153152
self, name: _Str, *, default: None, validate: Callable | Iterable[Callable] = ()
154-
) -> _Str | None:
155-
...
153+
) -> _Str | None: ...
156154

157155
def str(
158156
self,
@@ -171,8 +169,7 @@ def bytes(
171169
encoding: Literal["hex"],
172170
default: type[_Missing] | _Bytes = _Missing,
173171
validate: Callable | Iterable[Callable] = (),
174-
) -> _Bytes:
175-
...
172+
) -> _Bytes: ...
176173

177174
@typing.overload
178175
def bytes(
@@ -182,8 +179,7 @@ def bytes(
182179
encoding: Literal["hex"],
183180
default: None,
184181
validate: Callable | Iterable[Callable] = (),
185-
) -> _Bytes | None:
186-
...
182+
) -> _Bytes | None: ...
187183

188184
def bytes(
189185
self,
@@ -202,14 +198,12 @@ def int(
202198
*,
203199
default: type[_Missing] | _Int = _Missing,
204200
validate: Callable | Iterable[Callable] = (),
205-
) -> _Int:
206-
...
201+
) -> _Int: ...
207202

208203
@typing.overload
209204
def int(
210205
self, name: _Str, *, default: None, validate: Callable | Iterable[Callable] = ()
211-
) -> _Int | None:
212-
...
206+
) -> _Int | None: ...
213207

214208
def int(
215209
self,
@@ -227,14 +221,12 @@ def bool(
227221
*,
228222
default: type[_Missing] | _Bool = _Missing,
229223
validate: Callable | Iterable[Callable] = (),
230-
) -> _Bool:
231-
...
224+
) -> _Bool: ...
232225

233226
@typing.overload
234227
def bool(
235228
self, name: _Str, *, default: None, validate: Callable | Iterable[Callable] = ()
236-
) -> _Bool | None:
237-
...
229+
) -> _Bool | None: ...
238230

239231
def bool(
240232
self,
@@ -252,14 +244,12 @@ def float(
252244
*,
253245
default: type[_Missing] | _Float = _Missing,
254246
validate: Callable | Iterable[Callable] = (),
255-
) -> _Float:
256-
...
247+
) -> _Float: ...
257248

258249
@typing.overload
259250
def float(
260251
self, name: _Str, *, default: None, validate: Callable | Iterable[Callable] = ()
261-
) -> _Float | None:
262-
...
252+
) -> _Float | None: ...
263253

264254
def float(
265255
self,
@@ -277,14 +267,12 @@ def decimal(
277267
*,
278268
default: type[_Missing] | D = _Missing,
279269
validate: Callable | Iterable[Callable] = (),
280-
) -> D:
281-
...
270+
) -> D: ...
282271

283272
@typing.overload
284273
def decimal(
285274
self, name: _Str, *, default: None, validate: Callable | Iterable[Callable] = ()
286-
) -> D | None:
287-
...
275+
) -> D | None: ...
288276

289277
def decimal(
290278
self,
@@ -314,14 +302,12 @@ def list(
314302
*,
315303
default: type[_Missing] | _List = _Missing,
316304
validate: Callable | Iterable[Callable] = (),
317-
) -> _List[_Str]:
318-
...
305+
) -> _List[_Str]: ...
319306

320307
@typing.overload
321308
def list(
322309
self, name: _Str, *, default: None, validate: Callable | Iterable[Callable] = ()
323-
) -> _List[_Str] | None:
324-
...
310+
) -> _List[_Str] | None: ...
325311

326312
@typing.overload
327313
def list(
@@ -331,8 +317,7 @@ def list(
331317
default: type[_Missing] | _List[_T] = _Missing,
332318
validate: Callable | Iterable[Callable] = (),
333319
subcast: Callable[..., _T],
334-
) -> _List[_T]:
335-
...
320+
) -> _List[_T]: ...
336321

337322
@typing.overload
338323
def list(
@@ -342,8 +327,7 @@ def list(
342327
default: None,
343328
validate: Callable | Iterable[Callable] = (),
344329
subcast: Callable[..., _T],
345-
) -> _List[_T] | None:
346-
...
330+
) -> _List[_T] | None: ...
347331

348332
def list(
349333
self,

0 commit comments

Comments
 (0)