Skip to content

Commit bd2e639

Browse files
Export typing information (#487)
Signed-off-by: Michael Carlstrom <[email protected]>
1 parent 40fa2bd commit bd2e639

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

ament_mypy/ament_mypy/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from xml.sax.saxutils import escape
2525
from xml.sax.saxutils import quoteattr
2626

27-
import mypy.api # type: ignore
27+
import mypy.api
2828

2929

3030
def main(argv: List[str] = sys.argv[1:]) -> int:
@@ -148,11 +148,11 @@ def _generate_mypy_report(paths: List[str],
148148
mypy_argv.append('--show-error-context')
149149
mypy_argv.append('--show-column-numbers')
150150
mypy_argv += paths
151-
res = mypy.api.run(mypy_argv) # type: Tuple[str, str, int]
151+
res = mypy.api.run(mypy_argv)
152152
return res
153153

154154

155-
def _get_xunit_content(errors: List[Match],
155+
def _get_xunit_content(errors: List[Match[str]],
156156
testname: str,
157157
filenames: List[str],
158158
elapsed: float) -> str:
@@ -239,7 +239,7 @@ def _get_files(paths: List[str]) -> List[str]:
239239
return [os.path.normpath(f) for f in files]
240240

241241

242-
def _get_errors(report_string: str) -> List[Match]:
242+
def _get_errors(report_string: str) -> List[Match[str]]:
243243
return list(re.finditer(r'^(?P<filename>([a-zA-Z]:)?([^:])+):((?P<lineno>\d+):)?((?P<colno>\d+):)?\ (?P<type>error|warning|note):\ (?P<msg>.*)$', report_string, re.MULTILINE)) # noqa: E501
244244

245245

ament_mypy/ament_mypy/py.typed

Whitespace-only changes.

ament_mypy/ament_mypy/pytest_marker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
from _pytest.config import Config
1415

1516

16-
def pytest_configure(config):
17+
def pytest_configure(config: Config) -> None:
1718
config.addinivalue_line(
1819
'markers', 'mypy: marks tests checking for mypy compliance')

0 commit comments

Comments
 (0)