Skip to content

Commit f39ffaa

Browse files
author
daniel.eades
committed
don't blanket ignore missing type stubs
1 parent cd307a9 commit f39ffaa

File tree

5 files changed

+36
-15
lines changed

5 files changed

+36
-15
lines changed

.mypy.ini

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
[mypy]
2-
3-
ignore_missing_imports = true
4-
no_implicit_optional = true
52
check_untyped_defs = true
63

74
cache_dir = .cache/mypy/
85

96
[mypy-doorstop.*.tests.*]
10-
117
ignore_errors = True
8+
9+
10+
# Dependences with no type stubs
11+
12+
[mypy-frontmatter]
13+
ignore_missing_imports = true
14+
15+
[mypy-bottle]
16+
ignore_missing_imports = true
17+
18+
[mypy-plantuml_markdown]
19+
ignore_missing_imports = true

doorstop/core/exporter.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def _get_xlsx(obj, auto):
271271
# Populate cells
272272
for row, data in enumerate(_tabulate(obj, auto=auto), start=1):
273273
for col_idx, value in enumerate(data, start=1):
274-
cell = worksheet.cell(column=col_idx, row=row)
274+
cell = worksheet.cell(column=col_idx, row=row) # type: ignore[union-attr]
275275

276276
# wrap text in every cell
277277
alignment = openpyxl.styles.Alignment(
@@ -294,19 +294,19 @@ def _get_xlsx(obj, auto):
294294

295295
# Add filter up to the last column
296296
col_letter = openpyxl.utils.get_column_letter(len(col_widths))
297-
worksheet.auto_filter.ref = "A1:%s1" % col_letter
297+
worksheet.auto_filter.ref = "A1:%s1" % col_letter # type: ignore[union-attr]
298298

299299
# Set column width based on column contents
300300
for col in col_widths:
301301
if col_widths[col] > XLSX_MAX_WIDTH:
302302
width = XLSX_MAX_WIDTH
303303
else:
304304
width = col_widths[col] + XLSX_FILTER_PADDING
305-
col_letter = openpyxl.utils.get_column_letter(col)
306-
worksheet.column_dimensions[col_letter].width = width
305+
col_letter = openpyxl.utils.get_column_letter(col) # type: ignore[arg-type]
306+
worksheet.column_dimensions[col_letter].width = width # type: ignore[union-attr]
307307

308308
# Freeze top row
309-
worksheet.freeze_panes = worksheet.cell(row=2, column=1)
309+
worksheet.freeze_panes = worksheet.cell(row=2, column=1) # type: ignore[union-attr]
310310

311311
return workbook
312312

doorstop/core/importer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def _file_xlsx(path, document, mapping=None):
197197
index = 0
198198

199199
# Extract header and data rows
200-
for index, row in enumerate(worksheet.iter_rows()):
200+
for index, row in enumerate(worksheet.iter_rows()): # type: ignore[union-attr]
201201
row2 = []
202202
for cell in row:
203203
if index == 0:

poetry.lock

Lines changed: 17 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ mypy = ">=1.1.1"
6868
pydocstyle = "*"
6969
pylint = "~3.2.0"
7070
types-markdown = "*"
71+
types-openpyxl = "*"
7172
types-pyyaml = "*"
7273
types-requests = "*"
7374
types-setuptools = "*"

0 commit comments

Comments
 (0)