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

assert_reference_unique.sh does not discard trailing spaces #6697

Closed
ggbecker opened this issue Mar 12, 2021 · 1 comment · Fixed by #6702
Closed

assert_reference_unique.sh does not discard trailing spaces #6697

ggbecker opened this issue Mar 12, 2021 · 1 comment · Fixed by #6702
Labels
Bash Bash remediation update.

Comments

@ggbecker
Copy link
Member

Description of problem:

assert_reference_unique.sh considers trailing whitespaces as part of the identifiers and sometimes it can lead that two identical identifiers are not properly identified.

The test needs to be updated to discard any trailing space from the extracted identifier before doing the comparison.

Here is a case of identifiers that had trailing space and caused problems:

@ggbecker ggbecker added the Bash Bash remediation update. label Mar 12, 2021
@ggbecker
Copy link
Member Author

It appears we have many trailing whitespaces across the project

for example:
find . -type f -name 'shared.xml' -exec sed --in-place 's/[[:space:]]\+$//' {} \+
find . -type f -name '*.yml' -exec sed --in-place 's/[[:space:]]\+$//' {} \+

We should consider adding some kind of tests to prevent that in PR, for example: https://github.com/marketplace/actions/find-trailing-whitespace

It's probably a good idea to remove all trailing whitespaces at once, but that will bring a lot of changes to multiples files ;(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bash Bash remediation update.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant