mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Use LF in generated files (#7305)
This commit is contained in:
@@ -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"
|
||||
@@ -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):
|
||||
|
||||
@@ -10,7 +10,7 @@ from jinja2 import Environment, FileSystemLoader
|
||||
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(
|
||||
|
||||
@@ -14,7 +14,7 @@ from jinja2 import Environment, FileSystemLoader
|
||||
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):
|
||||
|
||||
@@ -14,7 +14,7 @@ from jinja2 import Environment, FileSystemLoader
|
||||
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):
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -14,7 +14,7 @@ from jinja2 import Environment, FileSystemLoader
|
||||
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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -13,7 +13,7 @@ from pathlib import Path
|
||||
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):
|
||||
|
||||
@@ -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",
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user