Skip to content

Commit

Permalink
Feature/better type annotations (#16)
Browse files Browse the repository at this point in the history
* Better type annotations

* Empty commit to trigger workflow

Co-authored-by: Luka Stout <[email protected]>
  • Loading branch information
lstout and lstout authored Mar 16, 2022
1 parent 3f3cde3 commit 1616f65
Show file tree
Hide file tree
Showing 19 changed files with 108 additions and 1,164 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks

default_language_version:
python: python3
python: python3.8

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -22,7 +22,7 @@ repos:
hooks:
- id: reorder-python-imports
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.812
rev: v0.940
hooks:
- id: mypy
args: ['--config-file', './mypy.ini']
args: [--install-types, --non-interactive]
12 changes: 6 additions & 6 deletions docs/grpc_argument_validator/argument_validator_config.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<meta name="generator" content="pdoc 0.9.2" />
<meta name="generator" content="pdoc 0.10.0" />
<title>grpc_argument_validator.argument_validator_config API documentation</title>
<meta name="description" content="" />
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
Expand Down Expand Up @@ -34,7 +34,7 @@ <h1 class="title">Module <code>grpc_argument_validator.argument_validator_config
_use_rich_grpc_errors = False

@classmethod
def set_rich_grpc_errors(cls, enabled: bool = True):
def set_rich_grpc_errors(cls, enabled: bool = True) -&gt; None:
&#34;&#34;&#34;
Set the option to use rich gRPC errors
&#34;&#34;&#34;
Expand Down Expand Up @@ -74,7 +74,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
_use_rich_grpc_errors = False

@classmethod
def set_rich_grpc_errors(cls, enabled: bool = True):
def set_rich_grpc_errors(cls, enabled: bool = True) -&gt; None:
&#34;&#34;&#34;
Set the option to use rich gRPC errors
&#34;&#34;&#34;
Expand All @@ -90,7 +90,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
<h3>Static methods</h3>
<dl>
<dt id="grpc_argument_validator.argument_validator_config.ArgumentValidatorConfig.set_rich_grpc_errors"><code class="name flex">
<span>def <span class="ident">set_rich_grpc_errors</span></span>(<span>enabled: bool = True)</span>
<span>def <span class="ident">set_rich_grpc_errors</span></span>(<span>enabled: bool = True)> None</span>
</code></dt>
<dd>
<div class="desc"><p>Set the option to use rich gRPC errors</p></div>
Expand All @@ -99,7 +99,7 @@ <h3>Static methods</h3>
<span>Expand source code</span>
</summary>
<pre><code class="python">@classmethod
def set_rich_grpc_errors(cls, enabled: bool = True):
def set_rich_grpc_errors(cls, enabled: bool = True) -&gt; None:
&#34;&#34;&#34;
Set the option to use rich gRPC errors
&#34;&#34;&#34;
Expand Down Expand Up @@ -154,7 +154,7 @@ <h4><code><a title="grpc_argument_validator.argument_validator_config.ArgumentVa
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
</footer>
</body>
</html>
4 changes: 2 additions & 2 deletions docs/grpc_argument_validator/argument_validators.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<meta name="generator" content="pdoc 0.9.2" />
<meta name="generator" content="pdoc 0.10.0" />
<title>grpc_argument_validator.argument_validators API documentation</title>
<meta name="description" content="" />
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
Expand Down Expand Up @@ -393,7 +393,7 @@ <h4><code><a title="grpc_argument_validator.argument_validators.UUIDBytesValidat
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
</footer>
</body>
</html>
84 changes: 0 additions & 84 deletions docs/grpc_argument_validator/field_path.html

This file was deleted.

10 changes: 5 additions & 5 deletions docs/grpc_argument_validator/fields.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<meta name="generator" content="pdoc 0.9.2" />
<meta name="generator" content="pdoc 0.10.0" />
<title>grpc_argument_validator.fields API documentation</title>
<meta name="description" content="" />
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
Expand Down Expand Up @@ -41,7 +41,7 @@ <h1 class="title">Module <code>grpc_argument_validator.fields</code></h1>
return re.match(r&#34;^(?:\.|\.?(?:[a-zA-Z][a-zA-Z_0-9]*\.)*(?:[a-zA-Z][a-zA-Z_0-9]*)(?:\[\])?)$&#34;, path) is not None


def validate_field_names(field_names: typing.Iterable[str]):
def validate_field_names(field_names: typing.Iterable[str]) -&gt; None:
&#34;&#34;&#34;
Validates that all field names adhere to the Protobuf 3 language specification

Expand Down Expand Up @@ -92,7 +92,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
</details>
</dd>
<dt id="grpc_argument_validator.fields.validate_field_names"><code class="name flex">
<span>def <span class="ident">validate_field_names</span></span>(<span>field_names: Iterable[str])</span>
<span>def <span class="ident">validate_field_names</span></span>(<span>field_names: Iterable[str])> None</span>
</code></dt>
<dd>
<div class="desc"><p>Validates that all field names adhere to the Protobuf 3 language specification</p>
Expand All @@ -106,7 +106,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def validate_field_names(field_names: typing.Iterable[str]):
<pre><code class="python">def validate_field_names(field_names: typing.Iterable[str]) -&gt; None:
&#34;&#34;&#34;
Validates that all field names adhere to the Protobuf 3 language specification

Expand Down Expand Up @@ -151,7 +151,7 @@ <h1>Index</h1>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
</footer>
</body>
</html>
Loading

0 comments on commit 1616f65

Please sign in to comment.