Skip to content

Commit

Permalink
chore: add type hint check (#840)
Browse files Browse the repository at this point in the history
  • Loading branch information
leahecole authored Nov 5, 2020
1 parent c7824ea commit 3d3e94c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion synthtool/gcp/templates/python_samples/noxfile.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ TEST_CONFIG = {
# You can opt out from the test for specific Python versions.
'ignored_versions': ["2.7"],

# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
'enforce_type_hints': False,

# An envvar key for determining the project id to use. Change it
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a
# build specific Cloud project. You can also use your own string
Expand Down Expand Up @@ -132,7 +136,10 @@ FLAKE8_COMMON_ARGS = [

@nox.session
def lint(session):
session.install("flake8", "flake8-import-order")
if not TEST_CONFIG['enforce_type_hints']:
session.install("flake8", "flake8-import-order")
else:
session.install("flake8", "flake8-import-order", "flake8-annotations")

local_names = _determine_local_import_names(".")
args = FLAKE8_COMMON_ARGS + [
Expand Down

0 comments on commit 3d3e94c

Please sign in to comment.