Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that warnings are treated as errors and fix encoding errors #94

Merged
merged 4 commits into from
Jul 17, 2023
Merged
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
4 changes: 2 additions & 2 deletions bump_pydantic/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def main(
progress.advance(task)

# Visitor logic
code = Path(filename).read_text()
code = Path(filename).read_text(encoding="utf8")
module = cst.parse_module(code)
module_and_package = calculate_module_and_package(str(package), filename)

Expand All @@ -109,7 +109,7 @@ def main(

codemods = gather_codemods(disabled=disable)

log_fp = log_file.open("a+")
log_fp = log_file.open("a+", encoding="utf8")
partial_run_codemods = functools.partial(run_codemods, codemods, metadata_manager, scratch, package, diff)
with Progress(*Progress.get_default_columns(), transient=True) as progress:
task = progress.add_task(description="Executing codemods...", total=len(files))
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ target-version = 'py38'

[tool.pytest.ini_options]
xfail_strict = true
filterwarnings = [
# Turn warnings that aren't filtered into exceptions
"error",
Kludex marked this conversation as resolved.
Show resolved Hide resolved
"ignore::pytest.PytestUnraisableExceptionWarning"
]

[tool.coverage.run]
branch = true
Expand Down