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

Plugin/LineEndingCheck: Add autocrlf warning #260

Merged

Conversation

apop5
Copy link
Contributor

@apop5 apop5 commented Feb 10, 2023

Preface

Please ensure you have read the contribution docs prior
to submitting the pull request. In particular,
pull request guidelines.

Description

LineEndingCheck's ReadMe.md recommends that autocrlf=false, but developers may not have configured their system with this setting. This change generates a warning message when it determines that the autocrlf does not match the recommended setting.

For each item, place an "x" in between [ and ] if true. Example: [x].
(you can also check items in the GitHub UI)

  • Impacts functionality?
    • Functionality - Does the change ultimately impact how firmware functions?
    • Examples: Add a new library, publish a new PPI, update an algorithm, ...
  • Impacts security?
    • Security - Does the change have a direct security impact on an application,
      flow, or firmware?
    • Examples: Crypto algorithm change, buffer overflow fix, parameter
      validation improvement, ...
  • Breaking change?
    • Breaking change - Will anyone consuming this change experience a break
      in build or boot behavior?
    • Examples: Add a new library class, move a module to a different repo, call
      a function in a new library class in a pre-existing module, ...
  • Includes tests?
    • Tests - Does the change include any explicit test code?
    • Examples: Unit tests, integration tests, robot tests, ...
  • Includes documentation?
    • Documentation - Does the change contain explicit documentation additions
      outside direct code modifications (and comments)?
    • Examples: Update readme file, add feature readme file, link to documentation
      on an a separate Web page, ...

How This Was Tested

Testing by configuring a system with git config --global core.autocrlf true and running a CI build to verify message is displayed, then by configuring git config --global core.autocrlf false and running a CI build to verify warning message is not displayed.
Tested when no core.autocrlf is is set (deleting from config file).

Integration Instructions

n/a

@apop5 apop5 requested a review from makubacki February 10, 2023 20:23
@github-actions github-actions bot added the impact:non-functional Does not have a functional impact label Feb 10, 2023
@apop5 apop5 added the impact:testing Affects testing label Feb 10, 2023
@apop5 apop5 self-assigned this Feb 10, 2023
@apop5 apop5 added the urgency:low Little to no impact label Feb 10, 2023
@apop5 apop5 requested a review from Flickdm February 10, 2023 20:49
@github-actions github-actions bot removed the impact:testing Affects testing label Feb 10, 2023
@makubacki makubacki changed the title User/apop5/addwarningtolineending Plugin/LineEndingCheck: Add autocrlf warning Feb 10, 2023
Copy link
Member

@makubacki makubacki left a comment

Choose a reason for hiding this comment

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

Approved. Please consider taking the suggestions.

@apop5 apop5 requested a review from Javagedes February 15, 2023 17:31
@Javagedes
Copy link
Contributor

Javagedes commented Feb 15, 2023

@apop5 I currently have a PR in edk2-pytool-extensions that synchronizes all git commands to use GitPython rather than RunCmd. tianocore/edk2-pytool-extensions#407

Once the edk2-pytool-extensions PR is in and GitPython is installed with the package, then the changes in this PR will need to be updated to something along the lines of the following:

r = Repo(workspace_root)
try:
    result = r.config_reader().get_value("core", "autocrlf"))
except NoOptionError as e:
    pass
    # Do something with this error

get_value() also allows you to set a default value if not found, if you would like to handle the option not existing that way instead of through the exception.

@apop5
Copy link
Contributor Author

apop5 commented Feb 16, 2023

@Javagedes I'll wait and update the PR after the edk2-pytool-extensions PR completes, and a release is made and picked up.

This or really is meant to be informational, so that a warning is generated. I would see problems trying to change a user's git environment.

@makubacki
Copy link
Member

@apop5 you should be able to come back to this now.

@github-actions github-actions bot added the language:python Pull requests that update Python code label Mar 1, 2023
@apop5 apop5 force-pushed the user/apop5/addwarningtolineending branch from 750838e to cb1c5f0 Compare March 1, 2023 20:52
@github-actions github-actions bot removed the language:python Pull requests that update Python code label Mar 1, 2023
@apop5
Copy link
Contributor Author

apop5 commented Mar 1, 2023

@Javagedes @makubacki

PR has been updated to use GitPython.

@apop5 apop5 merged commit 30e9a1d into microsoft:release/202208 Mar 1, 2023
TaylorBeebe pushed a commit to TaylorBeebe/mu_basecore that referenced this pull request Apr 27, 2023
# Preface

Please ensure you have read the [contribution
docs](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md) prior
to submitting the pull request. In particular,
[pull request
guidelines](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md#pull-request-best-practices).

## Description

LineEndingCheck's ReadMe.md recommends that autocrlf=false, but
developers may not have configured their system with this setting. This
change generates a warning message when it determines that the autocrlf
does not match the recommended setting.


For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Testing by configuring a system with `git config --global core.autocrlf
true` and running a CI build to verify message is displayed, then by
configuring `git config --global core.autocrlf false` and running a CI
build to verify warning message is not displayed.
Tested when no core.autocrlf is is set (deleting from config file).

## Integration Instructions

n/a
kenlautner pushed a commit that referenced this pull request Apr 28, 2023
# Preface

Please ensure you have read the [contribution
docs](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md) prior
to submitting the pull request. In particular,
[pull request
guidelines](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md#pull-request-best-practices).

## Description

LineEndingCheck's ReadMe.md recommends that autocrlf=false, but
developers may not have configured their system with this setting. This
change generates a warning message when it determines that the autocrlf
does not match the recommended setting.


For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Testing by configuring a system with `git config --global core.autocrlf
true` and running a CI build to verify message is displayed, then by
configuring `git config --global core.autocrlf false` and running a CI
build to verify warning message is not displayed.
Tested when no core.autocrlf is is set (deleting from config file).

## Integration Instructions

n/a
kenlautner pushed a commit that referenced this pull request May 3, 2023
# Preface

Please ensure you have read the [contribution
docs](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md) prior
to submitting the pull request. In particular,
[pull request
guidelines](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md#pull-request-best-practices).

## Description

LineEndingCheck's ReadMe.md recommends that autocrlf=false, but
developers may not have configured their system with this setting. This
change generates a warning message when it determines that the autocrlf
does not match the recommended setting.


For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Testing by configuring a system with `git config --global core.autocrlf
true` and running a CI build to verify message is displayed, then by
configuring `git config --global core.autocrlf false` and running a CI
build to verify warning message is not displayed.
Tested when no core.autocrlf is is set (deleting from config file).

## Integration Instructions

n/a
kenlautner pushed a commit that referenced this pull request May 4, 2023
# Preface

Please ensure you have read the [contribution
docs](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md) prior
to submitting the pull request. In particular,
[pull request
guidelines](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md#pull-request-best-practices).

## Description

LineEndingCheck's ReadMe.md recommends that autocrlf=false, but
developers may not have configured their system with this setting. This
change generates a warning message when it determines that the autocrlf
does not match the recommended setting.


For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Testing by configuring a system with `git config --global core.autocrlf
true` and running a CI build to verify message is displayed, then by
configuring `git config --global core.autocrlf false` and running a CI
build to verify warning message is not displayed.
Tested when no core.autocrlf is is set (deleting from config file).

## Integration Instructions

n/a
kenlautner pushed a commit that referenced this pull request May 4, 2023
# Preface

Please ensure you have read the [contribution
docs](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md) prior
to submitting the pull request. In particular,
[pull request
guidelines](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md#pull-request-best-practices).

## Description

LineEndingCheck's ReadMe.md recommends that autocrlf=false, but
developers may not have configured their system with this setting. This
change generates a warning message when it determines that the autocrlf
does not match the recommended setting.


For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Testing by configuring a system with `git config --global core.autocrlf
true` and running a CI build to verify message is displayed, then by
configuring `git config --global core.autocrlf false` and running a CI
build to verify warning message is not displayed.
Tested when no core.autocrlf is is set (deleting from config file).

## Integration Instructions

n/a
kenlautner pushed a commit that referenced this pull request May 5, 2023
Makes the following changes:

1. Recursively discovers files in packages instead of just checking
   the top-level package directory.

   The pattern should recursively find files relative to the package
   which accomplished with `**` in this change.

2. Differentiates between binary and text files, skipping line
   ending checks in binary files.

3. Verifies a path discovered is a file. Directories may rarely
   contain a dot in the name appearing in the path result list.

4. For files with issues, print the relative file path to the
   workspace. This is less than verbose than absolute, unique
   enough to find the file, and recognized for shortcut clicking
   in IDEs like VS Code.

5. For files with issues, print the relative file path to the
   file in POSIX format (with forward slashes). This makes copy/
   paste easy to tools like unixtodos and is equally recognized
   as a valid file path in IDEs like VS Code on Windows.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

.pytool/Plugin/LineEndingCheck: Add git ignore support

Adds support to ignore git ignored files and files under submodules
since those are either addressed in their respective repo's CI or
from an external project.

Some optimizations are also made to improve performance.

As the comment in the code states, these changes call the system git
command until GitPython is more widely used in the edk2 tool modules.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

Plugin/LineEndingCheck: Add autocrlf warning (#260)

LineEndingCheck's ReadMe.md recommends that autocrlf=false, but
developers may not have configured their system with this setting. This
change generates a warning message when it determines that the autocrlf
does not match the recommended setting.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

Testing by configuring a system with `git config --global core.autocrlf
true` and running a CI build to verify message is displayed, then by
configuring `git config --global core.autocrlf false` and running a CI
build to verify warning message is not displayed.
Tested when no core.autocrlf is is set (deleting from config file).

n/a
kenlautner pushed a commit that referenced this pull request May 5, 2023
Makes the following changes:

1. Recursively discovers files in packages instead of just checking
   the top-level package directory.

   The pattern should recursively find files relative to the package
   which accomplished with `**` in this change.

2. Differentiates between binary and text files, skipping line
   ending checks in binary files.

3. Verifies a path discovered is a file. Directories may rarely
   contain a dot in the name appearing in the path result list.

4. For files with issues, print the relative file path to the
   workspace. This is less than verbose than absolute, unique
   enough to find the file, and recognized for shortcut clicking
   in IDEs like VS Code.

5. For files with issues, print the relative file path to the
   file in POSIX format (with forward slashes). This makes copy/
   paste easy to tools like unixtodos and is equally recognized
   as a valid file path in IDEs like VS Code on Windows.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

.pytool/Plugin/LineEndingCheck: Add git ignore support

Adds support to ignore git ignored files and files under submodules
since those are either addressed in their respective repo's CI or
from an external project.

Some optimizations are also made to improve performance.

As the comment in the code states, these changes call the system git
command until GitPython is more widely used in the edk2 tool modules.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

Plugin/LineEndingCheck: Add autocrlf warning (#260)

LineEndingCheck's ReadMe.md recommends that autocrlf=false, but
developers may not have configured their system with this setting. This
change generates a warning message when it determines that the autocrlf
does not match the recommended setting.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

Testing by configuring a system with `git config --global core.autocrlf
true` and running a CI build to verify message is displayed, then by
configuring `git config --global core.autocrlf false` and running a CI
build to verify warning message is not displayed.
Tested when no core.autocrlf is is set (deleting from config file).

n/a
kenlautner pushed a commit that referenced this pull request May 9, 2023
Makes the following changes:

1. Recursively discovers files in packages instead of just checking
   the top-level package directory.

   The pattern should recursively find files relative to the package
   which accomplished with `**` in this change.

2. Differentiates between binary and text files, skipping line
   ending checks in binary files.

3. Verifies a path discovered is a file. Directories may rarely
   contain a dot in the name appearing in the path result list.

4. For files with issues, print the relative file path to the
   workspace. This is less than verbose than absolute, unique
   enough to find the file, and recognized for shortcut clicking
   in IDEs like VS Code.

5. For files with issues, print the relative file path to the
   file in POSIX format (with forward slashes). This makes copy/
   paste easy to tools like unixtodos and is equally recognized
   as a valid file path in IDEs like VS Code on Windows.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

.pytool/Plugin/LineEndingCheck: Add git ignore support

Adds support to ignore git ignored files and files under submodules
since those are either addressed in their respective repo's CI or
from an external project.

Some optimizations are also made to improve performance.

As the comment in the code states, these changes call the system git
command until GitPython is more widely used in the edk2 tool modules.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

Plugin/LineEndingCheck: Add autocrlf warning (#260)

LineEndingCheck's ReadMe.md recommends that autocrlf=false, but
developers may not have configured their system with this setting. This
change generates a warning message when it determines that the autocrlf
does not match the recommended setting.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

Testing by configuring a system with `git config --global core.autocrlf
true` and running a CI build to verify message is displayed, then by
configuring `git config --global core.autocrlf false` and running a CI
build to verify warning message is not displayed.
Tested when no core.autocrlf is is set (deleting from config file).

n/a
kenlautner pushed a commit that referenced this pull request Oct 17, 2023
Makes the following changes:

1. Recursively discovers files in packages instead of just checking
   the top-level package directory.

   The pattern should recursively find files relative to the package
   which accomplished with `**` in this change.

2. Differentiates between binary and text files, skipping line
   ending checks in binary files.

3. Verifies a path discovered is a file. Directories may rarely
   contain a dot in the name appearing in the path result list.

4. For files with issues, print the relative file path to the
   workspace. This is less than verbose than absolute, unique
   enough to find the file, and recognized for shortcut clicking
   in IDEs like VS Code.

5. For files with issues, print the relative file path to the
   file in POSIX format (with forward slashes). This makes copy/
   paste easy to tools like unixtodos and is equally recognized
   as a valid file path in IDEs like VS Code on Windows.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

.pytool/Plugin/LineEndingCheck: Add git ignore support

Adds support to ignore git ignored files and files under submodules
since those are either addressed in their respective repo's CI or
from an external project.

Some optimizations are also made to improve performance.

As the comment in the code states, these changes call the system git
command until GitPython is more widely used in the edk2 tool modules.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

Plugin/LineEndingCheck: Add autocrlf warning (#260)

LineEndingCheck's ReadMe.md recommends that autocrlf=false, but
developers may not have configured their system with this setting. This
change generates a warning message when it determines that the autocrlf
does not match the recommended setting.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

Testing by configuring a system with `git config --global core.autocrlf
true` and running a CI build to verify message is displayed, then by
configuring `git config --global core.autocrlf false` and running a CI
build to verify warning message is not displayed.
Tested when no core.autocrlf is is set (deleting from config file).

n/a
kenlautner pushed a commit that referenced this pull request Oct 18, 2023
Makes the following changes:

1. Recursively discovers files in packages instead of just checking
   the top-level package directory.

   The pattern should recursively find files relative to the package
   which accomplished with `**` in this change.

2. Differentiates between binary and text files, skipping line
   ending checks in binary files.

3. Verifies a path discovered is a file. Directories may rarely
   contain a dot in the name appearing in the path result list.

4. For files with issues, print the relative file path to the
   workspace. This is less than verbose than absolute, unique
   enough to find the file, and recognized for shortcut clicking
   in IDEs like VS Code.

5. For files with issues, print the relative file path to the
   file in POSIX format (with forward slashes). This makes copy/
   paste easy to tools like unixtodos and is equally recognized
   as a valid file path in IDEs like VS Code on Windows.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

.pytool/Plugin/LineEndingCheck: Add git ignore support

Adds support to ignore git ignored files and files under submodules
since those are either addressed in their respective repo's CI or
from an external project.

Some optimizations are also made to improve performance.

As the comment in the code states, these changes call the system git
command until GitPython is more widely used in the edk2 tool modules.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

Plugin/LineEndingCheck: Add autocrlf warning (#260)

LineEndingCheck's ReadMe.md recommends that autocrlf=false, but
developers may not have configured their system with this setting. This
change generates a warning message when it determines that the autocrlf
does not match the recommended setting.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

Testing by configuring a system with `git config --global core.autocrlf
true` and running a CI build to verify message is displayed, then by
configuring `git config --global core.autocrlf false` and running a CI
build to verify warning message is not displayed.
Tested when no core.autocrlf is is set (deleting from config file).

n/a
kenlautner pushed a commit that referenced this pull request Oct 18, 2023
Makes the following changes:

1. Recursively discovers files in packages instead of just checking
   the top-level package directory.

   The pattern should recursively find files relative to the package
   which accomplished with `**` in this change.

2. Differentiates between binary and text files, skipping line
   ending checks in binary files.

3. Verifies a path discovered is a file. Directories may rarely
   contain a dot in the name appearing in the path result list.

4. For files with issues, print the relative file path to the
   workspace. This is less than verbose than absolute, unique
   enough to find the file, and recognized for shortcut clicking
   in IDEs like VS Code.

5. For files with issues, print the relative file path to the
   file in POSIX format (with forward slashes). This makes copy/
   paste easy to tools like unixtodos and is equally recognized
   as a valid file path in IDEs like VS Code on Windows.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

.pytool/Plugin/LineEndingCheck: Add git ignore support

Adds support to ignore git ignored files and files under submodules
since those are either addressed in their respective repo's CI or
from an external project.

Some optimizations are also made to improve performance.

As the comment in the code states, these changes call the system git
command until GitPython is more widely used in the edk2 tool modules.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

Plugin/LineEndingCheck: Add autocrlf warning (#260)

LineEndingCheck's ReadMe.md recommends that autocrlf=false, but
developers may not have configured their system with this setting. This
change generates a warning message when it determines that the autocrlf
does not match the recommended setting.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

Testing by configuring a system with `git config --global core.autocrlf
true` and running a CI build to verify message is displayed, then by
configuring `git config --global core.autocrlf false` and running a CI
build to verify warning message is not displayed.
Tested when no core.autocrlf is is set (deleting from config file).

n/a
kenlautner pushed a commit that referenced this pull request Oct 20, 2023
Makes the following changes:

1. Recursively discovers files in packages instead of just checking
   the top-level package directory.

   The pattern should recursively find files relative to the package
   which accomplished with `**` in this change.

2. Differentiates between binary and text files, skipping line
   ending checks in binary files.

3. Verifies a path discovered is a file. Directories may rarely
   contain a dot in the name appearing in the path result list.

4. For files with issues, print the relative file path to the
   workspace. This is less than verbose than absolute, unique
   enough to find the file, and recognized for shortcut clicking
   in IDEs like VS Code.

5. For files with issues, print the relative file path to the
   file in POSIX format (with forward slashes). This makes copy/
   paste easy to tools like unixtodos and is equally recognized
   as a valid file path in IDEs like VS Code on Windows.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

.pytool/Plugin/LineEndingCheck: Add git ignore support

Adds support to ignore git ignored files and files under submodules
since those are either addressed in their respective repo's CI or
from an external project.

Some optimizations are also made to improve performance.

As the comment in the code states, these changes call the system git
command until GitPython is more widely used in the edk2 tool modules.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

Plugin/LineEndingCheck: Add autocrlf warning (#260)

LineEndingCheck's ReadMe.md recommends that autocrlf=false, but
developers may not have configured their system with this setting. This
change generates a warning message when it determines that the autocrlf
does not match the recommended setting.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

Testing by configuring a system with `git config --global core.autocrlf
true` and running a CI build to verify message is displayed, then by
configuring `git config --global core.autocrlf false` and running a CI
build to verify warning message is not displayed.
Tested when no core.autocrlf is is set (deleting from config file).

n/a
kenlautner pushed a commit that referenced this pull request Oct 23, 2023
Makes the following changes:

1. Recursively discovers files in packages instead of just checking
   the top-level package directory.

   The pattern should recursively find files relative to the package
   which accomplished with `**` in this change.

2. Differentiates between binary and text files, skipping line
   ending checks in binary files.

3. Verifies a path discovered is a file. Directories may rarely
   contain a dot in the name appearing in the path result list.

4. For files with issues, print the relative file path to the
   workspace. This is less than verbose than absolute, unique
   enough to find the file, and recognized for shortcut clicking
   in IDEs like VS Code.

5. For files with issues, print the relative file path to the
   file in POSIX format (with forward slashes). This makes copy/
   paste easy to tools like unixtodos and is equally recognized
   as a valid file path in IDEs like VS Code on Windows.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

.pytool/Plugin/LineEndingCheck: Add git ignore support

Adds support to ignore git ignored files and files under submodules
since those are either addressed in their respective repo's CI or
from an external project.

Some optimizations are also made to improve performance.

As the comment in the code states, these changes call the system git
command until GitPython is more widely used in the edk2 tool modules.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

Plugin/LineEndingCheck: Add autocrlf warning (#260)

LineEndingCheck's ReadMe.md recommends that autocrlf=false, but
developers may not have configured their system with this setting. This
change generates a warning message when it determines that the autocrlf
does not match the recommended setting.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

Testing by configuring a system with `git config --global core.autocrlf
true` and running a CI build to verify message is displayed, then by
configuring `git config --global core.autocrlf false` and running a CI
build to verify warning message is not displayed.
Tested when no core.autocrlf is is set (deleting from config file).

n/a
kenlautner pushed a commit that referenced this pull request Dec 16, 2023
Makes the following changes:

1. Recursively discovers files in packages instead of just checking
   the top-level package directory.

   The pattern should recursively find files relative to the package
   which accomplished with `**` in this change.

2. Differentiates between binary and text files, skipping line
   ending checks in binary files.

3. Verifies a path discovered is a file. Directories may rarely
   contain a dot in the name appearing in the path result list.

4. For files with issues, print the relative file path to the
   workspace. This is less than verbose than absolute, unique
   enough to find the file, and recognized for shortcut clicking
   in IDEs like VS Code.

5. For files with issues, print the relative file path to the
   file in POSIX format (with forward slashes). This makes copy/
   paste easy to tools like unixtodos and is equally recognized
   as a valid file path in IDEs like VS Code on Windows.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

.pytool/Plugin/LineEndingCheck: Add git ignore support

Adds support to ignore git ignored files and files under submodules
since those are either addressed in their respective repo's CI or
from an external project.

Some optimizations are also made to improve performance.

As the comment in the code states, these changes call the system git
command until GitPython is more widely used in the edk2 tool modules.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

Plugin/LineEndingCheck: Add autocrlf warning (#260)

LineEndingCheck's ReadMe.md recommends that autocrlf=false, but
developers may not have configured their system with this setting. This
change generates a warning message when it determines that the autocrlf
does not match the recommended setting.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

Testing by configuring a system with `git config --global core.autocrlf
true` and running a CI build to verify message is displayed, then by
configuring `git config --global core.autocrlf false` and running a CI
build to verify warning message is not displayed.
Tested when no core.autocrlf is is set (deleting from config file).

n/a
kenlautner pushed a commit that referenced this pull request Dec 18, 2023
Makes the following changes:

1. Recursively discovers files in packages instead of just checking
   the top-level package directory.

   The pattern should recursively find files relative to the package
   which accomplished with `**` in this change.

2. Differentiates between binary and text files, skipping line
   ending checks in binary files.

3. Verifies a path discovered is a file. Directories may rarely
   contain a dot in the name appearing in the path result list.

4. For files with issues, print the relative file path to the
   workspace. This is less than verbose than absolute, unique
   enough to find the file, and recognized for shortcut clicking
   in IDEs like VS Code.

5. For files with issues, print the relative file path to the
   file in POSIX format (with forward slashes). This makes copy/
   paste easy to tools like unixtodos and is equally recognized
   as a valid file path in IDEs like VS Code on Windows.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

.pytool/Plugin/LineEndingCheck: Add git ignore support

Adds support to ignore git ignored files and files under submodules
since those are either addressed in their respective repo's CI or
from an external project.

Some optimizations are also made to improve performance.

As the comment in the code states, these changes call the system git
command until GitPython is more widely used in the edk2 tool modules.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

Plugin/LineEndingCheck: Add autocrlf warning (#260)

LineEndingCheck's ReadMe.md recommends that autocrlf=false, but
developers may not have configured their system with this setting. This
change generates a warning message when it determines that the autocrlf
does not match the recommended setting.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

Testing by configuring a system with `git config --global core.autocrlf
true` and running a CI build to verify message is displayed, then by
configuring `git config --global core.autocrlf false` and running a CI
build to verify warning message is not displayed.
Tested when no core.autocrlf is is set (deleting from config file).

n/a
kenlautner pushed a commit to kenlautner/mu_basecore that referenced this pull request Jun 19, 2024
Makes the following changes:

1. Recursively discovers files in packages instead of just checking
   the top-level package directory.

   The pattern should recursively find files relative to the package
   which accomplished with `**` in this change.

2. Differentiates between binary and text files, skipping line
   ending checks in binary files.

3. Verifies a path discovered is a file. Directories may rarely
   contain a dot in the name appearing in the path result list.

4. For files with issues, print the relative file path to the
   workspace. This is less than verbose than absolute, unique
   enough to find the file, and recognized for shortcut clicking
   in IDEs like VS Code.

5. For files with issues, print the relative file path to the
   file in POSIX format (with forward slashes). This makes copy/
   paste easy to tools like unixtodos and is equally recognized
   as a valid file path in IDEs like VS Code on Windows.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

.pytool/Plugin/LineEndingCheck: Add git ignore support

Adds support to ignore git ignored files and files under submodules
since those are either addressed in their respective repo's CI or
from an external project.

Some optimizations are also made to improve performance.

As the comment in the code states, these changes call the system git
command until GitPython is more widely used in the edk2 tool modules.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

Plugin/LineEndingCheck: Add autocrlf warning (microsoft#260)

LineEndingCheck's ReadMe.md recommends that autocrlf=false, but
developers may not have configured their system with this setting. This
change generates a warning message when it determines that the autocrlf
does not match the recommended setting.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

Testing by configuring a system with `git config --global core.autocrlf
true` and running a CI build to verify message is displayed, then by
configuring `git config --global core.autocrlf false` and running a CI
build to verify warning message is not displayed.
Tested when no core.autocrlf is is set (deleting from config file).

n/a
kenlautner pushed a commit to kenlautner/mu_basecore that referenced this pull request Jun 21, 2024
Makes the following changes:

1. Recursively discovers files in packages instead of just checking
   the top-level package directory.

   The pattern should recursively find files relative to the package
   which accomplished with `**` in this change.

2. Differentiates between binary and text files, skipping line
   ending checks in binary files.

3. Verifies a path discovered is a file. Directories may rarely
   contain a dot in the name appearing in the path result list.

4. For files with issues, print the relative file path to the
   workspace. This is less than verbose than absolute, unique
   enough to find the file, and recognized for shortcut clicking
   in IDEs like VS Code.

5. For files with issues, print the relative file path to the
   file in POSIX format (with forward slashes). This makes copy/
   paste easy to tools like unixtodos and is equally recognized
   as a valid file path in IDEs like VS Code on Windows.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

.pytool/Plugin/LineEndingCheck: Add git ignore support

Adds support to ignore git ignored files and files under submodules
since those are either addressed in their respective repo's CI or
from an external project.

Some optimizations are also made to improve performance.

As the comment in the code states, these changes call the system git
command until GitPython is more widely used in the edk2 tool modules.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

Plugin/LineEndingCheck: Add autocrlf warning (microsoft#260)

LineEndingCheck's ReadMe.md recommends that autocrlf=false, but
developers may not have configured their system with this setting. This
change generates a warning message when it determines that the autocrlf
does not match the recommended setting.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

Testing by configuring a system with `git config --global core.autocrlf
true` and running a CI build to verify message is displayed, then by
configuring `git config --global core.autocrlf false` and running a CI
build to verify warning message is not displayed.
Tested when no core.autocrlf is is set (deleting from config file).

n/a
kenlautner pushed a commit to kenlautner/mu_basecore that referenced this pull request Jun 22, 2024
Makes the following changes:

1. Recursively discovers files in packages instead of just checking
   the top-level package directory.

   The pattern should recursively find files relative to the package
   which accomplished with `**` in this change.

2. Differentiates between binary and text files, skipping line
   ending checks in binary files.

3. Verifies a path discovered is a file. Directories may rarely
   contain a dot in the name appearing in the path result list.

4. For files with issues, print the relative file path to the
   workspace. This is less than verbose than absolute, unique
   enough to find the file, and recognized for shortcut clicking
   in IDEs like VS Code.

5. For files with issues, print the relative file path to the
   file in POSIX format (with forward slashes). This makes copy/
   paste easy to tools like unixtodos and is equally recognized
   as a valid file path in IDEs like VS Code on Windows.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

.pytool/Plugin/LineEndingCheck: Add git ignore support

Adds support to ignore git ignored files and files under submodules
since those are either addressed in their respective repo's CI or
from an external project.

Some optimizations are also made to improve performance.

As the comment in the code states, these changes call the system git
command until GitPython is more widely used in the edk2 tool modules.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

Plugin/LineEndingCheck: Add autocrlf warning (microsoft#260)

LineEndingCheck's ReadMe.md recommends that autocrlf=false, but
developers may not have configured their system with this setting. This
change generates a warning message when it determines that the autocrlf
does not match the recommended setting.

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

Testing by configuring a system with `git config --global core.autocrlf
true` and running a CI build to verify message is displayed, then by
configuring `git config --global core.autocrlf false` and running a CI
build to verify warning message is not displayed.
Tested when no core.autocrlf is is set (deleting from config file).

n/a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact:non-functional Does not have a functional impact urgency:low Little to no impact
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants