Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ concurrency:

jobs:
test_linux:
# UNDO ME, don't need this for this PR
if: false
name: Build and test Firedrake (Linux)
strategy:
# We want to know all of the tests which fail, so don't kill real if
Expand Down Expand Up @@ -481,11 +483,15 @@ jobs:
- name: Setup flake8 annotations
uses: rbialon/flake8-annotations@v1
- name: Install linting packages
run: pip install flake8 pylint
run: pip install flake8 mypy pylint
- name: Lint codebase
run: make lint GITHUB_ACTIONS_FORMATTING=1
- name: Run type checks
run: mypy -p firedrake -p pyop2 -p tsfc

build_docs:
# UNDO ME
if: false
name: Build documentation
runs-on: [self-hosted, Linux]
container:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def __init__(self, *operands, function_space, derivatives=None, argument_slots=(
def function_space(self):
return self._function_space

@staticmethod
def assemble_method(derivs, args):
"""Decorator helper function to specify the type of external operator type associated with each assembly methods.

Expand Down
21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,24 @@ pyop2 = [
"*.pyx",
"codegen/c/*.c",
]

[tool.mypy]
# from https://quantlane.com/blog/type-checking-large-codebase/

# TODO: enable at some point
# disallow_untyped_calls = true
# disallow_untyped_defs = true
# disallow_incomplete_defs = true
# disallow_untyped_decorators = true
# check_untyped_defs = true

# warn_redundant_casts = true
# warn_unused_ignores = true
# warn_unused_configs = true
# show_error_codes = true

ignore_missing_imports = true
follow_imports = "silent"
disable_error_code = ["attr-defined", "import-untyped"]

exclude = ["firedrake/_check"]
Loading