Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 27, 2025

User description

Files in src/main/target/FLYSPARKF4V4 had CRLF line endings inconsistent with the rest of the repository.

Changes

  • Line ending normalization: Converted CRLF → LF in CMakeLists.txt, config.c, target.h
  • Added .gitattributes: Prevents future CRLF commits in this folder
    * text=auto eol=lf
    

target.c already had LF endings and was unchanged.

Original prompt

Problem to solve

Some files in src/main/target/FLYSPARKF4V4 currently contain CR or CRLF line endings. This repository otherwise uses LF line endings in target files. We need a small PR that normalizes the files in the FLYSPARKF4V4 target folder to use Unix LF only (no CR or CRLF) while preserving file contents otherwise.

Scope

  • Repository: inavFlight/inav
  • Base branch: master
  • Target path: src/main/target/FLYSPARKF4V4/

Files to update (only change line endings, do not modify code or whitespace beyond line-ending normalization):

  • src/main/target/FLYSPARKF4V4/CMakeLists.txt
  • src/main/target/FLYSPARKF4V4/config.c
  • src/main/target/FLYSPARKF4V4/target.h
  • src/main/target/FLYSPARKF4V4/target.c (verify and ensure LF; if already LF, leave content unchanged but ensure repository stores LF)

Requirements

  1. Convert any CRLF or CR line endings in the files above to LF-only line endings.
  2. Preserve the exact file content other than line ending bytes. Do not reformat code, do not change indentation or other characters.
  3. Ensure the files end with a single newline (LF) at EOF.
  4. Add a .gitattributes file inside src/main/target/FLYSPARKF4V4/.gitattributes with a rule to enforce LF for files in this folder to avoid future accidental CRLF commits. Suggested content:
    • text=auto eol=lf
      (or more specific rules for common file types in the folder)
  5. Create a small, clearly named branch (for example: fix/line-endings-flysparkf4v4), commit the changes, and open a pull request against master with a descriptive PR title and summary.

Deliverables

  • A PR that contains only the minimal commits necessary to normalize line endings and add .gitattributes.
  • PR title: "Normalize line endings to LF in src/main/target/FLYSPARKF4V4"
  • PR description: explain what was changed (which files) and why (normalize to LF, prevent future CRLF), include that only line endings were changed and code content is unchanged.

Notes for the agent

  • Use the repository's current master as the base.
  • When editing files, ensure binary-safe handling so only CR (0x0D) bytes at ends of lines are removed where they form CRLF sequences; do not alter characters otherwise.
  • Run a quick verification that resulting files do not contain any CR (\r) bytes.
  • Keep commits minimal and atomic: one commit that converts the listed files and adds the .gitattributes file.

You can proceed to create the branch, apply the edits, and open the pull request.

This pull request was created as a result of the following prompt from Copilot chat.

Problem to solve

Some files in src/main/target/FLYSPARKF4V4 currently contain CR or CRLF line endings. This repository otherwise uses LF line endings in target files. We need a small PR that normalizes the files in the FLYSPARKF4V4 target folder to use Unix LF only (no CR or CRLF) while preserving file contents otherwise.

Scope

  • Repository: inavFlight/inav
  • Base branch: master
  • Target path: src/main/target/FLYSPARKF4V4/

Files to update (only change line endings, do not modify code or whitespace beyond line-ending normalization):

  • src/main/target/FLYSPARKF4V4/CMakeLists.txt
  • src/main/target/FLYSPARKF4V4/config.c
  • src/main/target/FLYSPARKF4V4/target.h
  • src/main/target/FLYSPARKF4V4/target.c (verify and ensure LF; if already LF, leave content unchanged but ensure repository stores LF)

Requirements

  1. Convert any CRLF or CR line endings in the files above to LF-only line endings.
  2. Preserve the exact file content other than line ending bytes. Do not reformat code, do not change indentation or other characters.
  3. Ensure the files end with a single newline (LF) at EOF.
  4. Add a .gitattributes file inside src/main/target/FLYSPARKF4V4/.gitattributes with a rule to enforce LF for files in this folder to avoid future accidental CRLF commits. Suggested content:
    • text=auto eol=lf
      (or more specific rules for common file types in the folder)
  5. Create a small, clearly named branch (for example: fix/line-endings-flysparkf4v4), commit the changes, and open a pull request against master with a descriptive PR title and summary.

Deliverables

  • A PR that contains only the minimal commits necessary to normalize line endings and add .gitattributes.
  • PR title: "Normalize line endings to LF in src/main/target/FLYSPARKF4V4"
  • PR description: explain what was changed (which files) and why (normalize to LF, prevent future CRLF), include that only line endings were changed and code content is unchanged.

Notes for the agent

  • Use the repository's current master as the base.
  • When editing files, ensure binary-safe handling so only CR (0x0D) bytes at ends of lines are removed where they form CRLF sequences; do not alter characters otherwise.
  • Run a quick verification that resulting files do not contain any CR (\r) bytes.
  • Keep commits minimal and atomic: one commit that converts the listed files and adds the .gitattributes file.

You can proceed to create the branch, apply the edits, and open the pull request.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.


PR Type

Other


Description

This description is generated by an AI tool. It may have inaccuracies

  • Normalize CRLF line endings to LF in FLYSPARKF4V4 target files

  • Add .gitattributes to enforce LF line endings going forward

  • Affected files: config.c, target.h, CMakeLists.txt

  • Code content unchanged, only line ending bytes modified


Diagram Walkthrough

flowchart LR
  A["FLYSPARKF4V4 files<br/>with CRLF endings"] -- "Convert CRLF to LF" --> B["Files with LF endings"]
  B -- "Add .gitattributes" --> C["Enforce LF for future commits"]
Loading

File Walkthrough

Relevant files
Formatting
config.c
Convert CRLF to LF line endings                                                   

src/main/target/FLYSPARKF4V4/config.c

  • Converted all CRLF line endings to LF
  • File content and code logic remain unchanged
  • 39 lines affected by line ending normalization
+39/-39 
target.h
Convert CRLF to LF line endings                                                   

src/main/target/FLYSPARKF4V4/target.h

  • Converted all CRLF line endings to LF
  • File content and code logic remain unchanged
  • 168 lines affected by line ending normalization
+168/-168
CMakeLists.txt
Convert CRLF to LF line ending                                                     

src/main/target/FLYSPARKF4V4/CMakeLists.txt

  • Converted CRLF line ending to LF
  • Single line file with normalized ending
+1/-1     
Configuration changes
.gitattributes
Add .gitattributes to enforce LF endings                                 

src/main/target/FLYSPARKF4V4/.gitattributes

  • Added new .gitattributes file to enforce LF line endings
  • Prevents future accidental CRLF commits in this folder
  • Rule: * text=auto eol=lf
+1/-0     

Copilot AI self-assigned this Nov 27, 2025
Copilot AI and others added 2 commits November 27, 2025 21:51
Co-authored-by: sensei-hacker <1971284+sensei-hacker@users.noreply.github.com>
Co-authored-by: sensei-hacker <1971284+sensei-hacker@users.noreply.github.com>
Copilot AI changed the title [WIP] Normalize line endings to LF in FLYSPARKF4V4 folder Normalize line endings to LF in src/main/target/FLYSPARKF4V4 Nov 27, 2025
Copilot AI requested a review from sensei-hacker November 27, 2025 21:55
Copilot finished work on behalf of sensei-hacker November 27, 2025 21:55
@sensei-hacker sensei-hacker marked this pull request as ready for review November 27, 2025 22:05
@qodo-code-review
Copy link
Contributor

PR Compliance Guide 🔍

All compliance sections have been disabled in the configurations.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

High-level Suggestion

Instead of adding a .gitattributes file to a specific subdirectory, move it to the project root to enforce a consistent line ending policy for the entire repository. [High-level, importance: 8]

Solution Walkthrough:

Before:

// .gitattributes is placed in a specific subdirectory,
// limiting its scope to only that folder.
project_root/
└── src/
    └── main/
        └── target/
            └── FLYSPARKF4V4/
                ├── .gitattributes
                │   └─ * text=auto eol=lf
                └── ... (other files with fixed line endings)

After:

// .gitattributes is moved to the project root,
// applying the line ending policy to the entire repository.
project_root/
├── .gitattributes
│   └─ * text=auto eol=lf
└── src/
    └── main/
        └── target/
            └── FLYSPARKF4V4/
                └── ... (other files with fixed line endings)

Comment on lines +48 to +71
#define USE_UART2
#define UART2_TX_PIN PA2
#define UART2_RX_PIN PA3

#define USE_UART3
#define UART3_TX_PIN PC10
#define UART3_RX_PIN PC11

// Internally routed to Bluetooth
#define USE_UART4
#define UART4_TX_PIN PA0
#define UART4_RX_PIN PA1

#define USE_UART5
#define UART5_TX_PIN PC12 // Not broken out
#define UART5_RX_PIN PD2 //ESC TLM

#define USE_UART6
#define UART6_TX_PIN PC6
#define UART6_RX_PIN PC7

#define USE_SOFTSERIAL1
#define SOFTSERIAL_1_TX_PIN PA2
#define SOFTSERIAL_1_RX_PIN PA2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Resolve a pin conflict where PA2 is assigned to both UART2_TX_PIN and SOFTSERIAL_1. Consider disabling SOFTSERIAL1 or reassigning its pins to fix the hardware conflict. [possible issue, importance: 9]

Suggested change
#define USE_UART2
#define UART2_TX_PIN PA2
#define UART2_RX_PIN PA3
#define USE_UART3
#define UART3_TX_PIN PC10
#define UART3_RX_PIN PC11
// Internally routed to Bluetooth
#define USE_UART4
#define UART4_TX_PIN PA0
#define UART4_RX_PIN PA1
#define USE_UART5
#define UART5_TX_PIN PC12 // Not broken out
#define UART5_RX_PIN PD2 //ESC TLM
#define USE_UART6
#define UART6_TX_PIN PC6
#define UART6_RX_PIN PC7
#define USE_SOFTSERIAL1
#define SOFTSERIAL_1_TX_PIN PA2
#define SOFTSERIAL_1_RX_PIN PA2
#define USE_UART2
#define UART2_TX_PIN PA2
#define UART2_RX_PIN PA3
...
// #define USE_SOFTSERIAL1
// #define SOFTSERIAL_1_TX_PIN PA2
// #define SOFTSERIAL_1_RX_PIN PA2

@sensei-hacker sensei-hacker merged commit 9c45a1d into master Nov 27, 2025
42 checks passed
@sensei-hacker sensei-hacker added this to the 9.0 milestone Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants