Skip to content

Commit

Permalink
Enforce newline ending
Browse files Browse the repository at this point in the history
  • Loading branch information
kdumontnu committed Oct 20, 2023
1 parent e4c5f11 commit c168905
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/generate_bom/compute_cogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ def fetch_price_for_part(part_number: str) -> dict[int, float]:
with ExitStack() as stack:
if args.output_file:
file = stack.enter_context(open(args.output_file, "w"))
writer = csv.writer(file)
writer = csv.writer(file, lineterminator="\n")
else:
writer = csv.writer(sys.stdout)
writer = csv.writer(sys.stdout, lineterminator="\n")

writer.writerow(headers)
writer.writerows(rows)
Expand Down
4 changes: 2 additions & 2 deletions examples/generate_bom/generate_bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ def sort_function(x: BomEntry) -> str:
with ExitStack() as stack:
if args.output_file is not None:
f = stack.enter_context(open(args.output_file, "w"))
writer = csv.writer(f)
writer = csv.writer(f, lineterminator="\n")
else:
writer = csv.writer(sys.stdout)
writer = csv.writer(sys.stdout, lineterminator="\n")

header = [
"Description",
Expand Down
Loading

0 comments on commit c168905

Please sign in to comment.