Skip to content

Commit

Permalink
Use lf in generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
rzblue committed Oct 29, 2024
1 parent f44c3ed commit 18a6cda
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions hal/generate_usage_reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def generate_usage_reporting(output_directory: Path, template_directory: Path):
)

frc_net_comm = output_directory / f"main/java/{java_package}/FRCNetComm.java"
frc_net_comm.write_text(contents, encoding="utf-8")
frc_net_comm.write_text(contents, encoding="utf-8", newline="\n")

with (template_directory / "FRCUsageReporting.h.in").open(
encoding="utf-8"
Expand All @@ -65,7 +65,7 @@ def generate_usage_reporting(output_directory: Path, template_directory: Path):
usage_reporting_hdr = (
output_directory / "main/native/include/hal/FRCUsageReporting.h"
)
usage_reporting_hdr.write_text(contents, encoding="utf-8")
usage_reporting_hdr.write_text(contents, encoding="utf-8", newline="\n")


def main(argv):
Expand Down
2 changes: 1 addition & 1 deletion ntcore/generate_topics.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
def Output(output_dir: Path, controller_name: str, contents: str):
output_dir.mkdir(parents=True, exist_ok=True)
output_file = output_dir / controller_name
output_file.write_text(contents, encoding="utf-8")
output_file.write_text(contents, encoding="utf-8", newline="\n")


def generate_topics(
Expand Down
2 changes: 1 addition & 1 deletion wpilibNewCommands/generate_hids.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
def write_controller_file(output_dir: Path, controller_name: str, contents: str):
output_dir.mkdir(parents=True, exist_ok=True)
output_file = output_dir / controller_name
output_file.write_text(contents, encoding="utf-8")
output_file.write_text(contents, encoding="utf-8", newline="\n")


def generate_hids(output_directory: Path, template_directory: Path, schema_file: Path):
Expand Down
2 changes: 1 addition & 1 deletion wpilibc/generate_hids.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
def write_controller_file(output_dir: Path, controller_name: str, contents: str):
output_dir.mkdir(parents=True, exist_ok=True)
output_file = output_dir / controller_name
output_file.write_text(contents, encoding="utf-8")
output_file.write_text(contents, encoding="utf-8", newline="\n")


def generate_hids(output_directory: Path, template_directory: Path, schema_file: Path):
Expand Down
2 changes: 1 addition & 1 deletion wpilibc/generate_pwm_motor_controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def render_template(
output_dir.mkdir(parents=True, exist_ok=True)

output_file = output_dir / filename
output_file.write_text(template.render(controller), encoding="utf-8")
output_file.write_text(template.render(controller), encoding="utf-8", newline="\n")


def generate_cpp_headers(
Expand Down
2 changes: 1 addition & 1 deletion wpilibj/generate_hids.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
def write_controller_file(output_dir: Path, controller_name: str, contents: str):
output_dir.mkdir(parents=True, exist_ok=True)
output_file = output_dir / controller_name
output_file.write_text(contents, encoding="utf-8")
output_file.write_text(contents, encoding="utf-8", newline="\n")


def generate_hids(output_directory: Path, template_directory: Path):
Expand Down
2 changes: 1 addition & 1 deletion wpilibj/generate_pwm_motor_controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def render_template(
output_dir.mkdir(parents=True, exist_ok=True)

output_file = output_dir / filename
output_file.write_text(template.render(controller), encoding="utf-8")
output_file.write_text(template.render(controller), encoding="utf-8", newline="\n")


def generate_pwm_motor_controllers(output_root, template_root):
Expand Down
2 changes: 1 addition & 1 deletion wpimath/generate_numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
def output(output_dir: Path, outfn: str, contents: str):
output_dir.mkdir(parents=True, exist_ok=True)
output_file = output_dir / outfn
output_file.write_text(contents, encoding="utf-8")
output_file.write_text(contents, encoding="utf-8", newline="\n")


def generate_numbers(output_directory: Path, template_root: Path):
Expand Down
1 change: 1 addition & 0 deletions wpimath/generate_quickbuf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def generate_quickbuf(
"// Copyright (c) FIRST and other WPILib contributors.\n// Open Source Software; you can modify and/or share it under the terms of\n// the WPILib BSD license file in the root directory of this project.\n"
+ content,
encoding="utf-8",
newline="\n",
)


Expand Down

0 comments on commit 18a6cda

Please sign in to comment.