-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Many useless trailing blanks in source code #15114
Comments
- run pre-commit tox profile to trim all trailing blanks - use several commits with a per-folder based strategy to ease their merge Issue sonic-net#15114 Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
- run pre-commit tox profile to trim all trailing blanks - use several commits with a per-folder based strategy to ease their merge Issue sonic-net#15114 Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
- run pre-commit tox profile to trim all trailing blanks - use several commits with a per-folder based strategy to ease their merge Issue sonic-net#15114 Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
… blanks - run pre-commit tox profile to trim all trailing blanks - use several commits with a per-folder based strategy to ease their merge Issue sonic-net#15114 Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
- Run pre-commit tox profile to trim all trailing blanks - Use several commits with a per-folder based strategy to ease their merge Issue sonic-net#15114 Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
- add a pre-commit yaml configuration file with a basic profile to remove trailing blanks - add a rule to exclude from its scope - patch files (generated from git diff) Trailing blanks are part of their syntax. - .conf files in the src folder Their trailing blanks removal make some tests fail during build. - jinja templates in docker folder Though trailing blank should not be part of the jinja2 syntax, these files use a known hack that requires trailing blanks. Their removal makes build fail. - create a tox configuration to run/install/uninstall/autoupdate pre-commit in a python venv - create a tox profile for the CI to run pre-commit only on files modified since this commit - add a shell script to ease running pre-commit inside various CI Issue sonic-net#15114 Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
Issue sonic-net#15114 Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
Issue sonic-net#15114 Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
- Run pre-commit tox profile to trim all trailing blanks - Use several commits with a per-folder based strategy to ease their merge Issue #15114 Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
- add a pre-commit yaml configuration file with a basic profile to remove trailing blanks - add a rule to exclude from its scope - patch files (generated from git diff) Trailing blanks are part of their syntax. - .conf files in the src folder Their trailing blanks removal make some tests fail during build. - jinja templates in docker folder Though trailing blank should not be part of the jinja2 syntax, these files use a known hack that requires trailing blanks. Their removal makes build fail. - create a tox configuration to run/install/uninstall/autoupdate pre-commit in a python venv - create a tox profile for the CI to run pre-commit only on files modified since this commit - add a shell script to ease running pre-commit inside various CI Issue sonic-net#15114 Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
In azure pipelines configuration - add a linter stage - add to the linter stage a tox job w/ 2 steps to run tox Issue sonic-net#15114 Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com> fix
Issue sonic-net#15114 Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
|
…g blanks - run pre-commit tox profile to trim all trailing blanks - use several commits with a per-folder based strategy to ease their merge Issue sonic-net#15114 Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
Thanks for your feedback. Such shell scripts commands do work. I do agree that trailing blanks complete trimming would be a big PR. I also understand from your comment that sudo permissions are required to clean some files. But I haven't caught where. |
- run pre-commit tox profile to trim all trailing blanks - use several commits with a per-folder based strategy to ease their merge Issue sonic-net#15114 Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
Trailing blanks are generally and strongly dis-advised by most programming languages best practices.
It is commonly admitted that they complicate the code maintenance.
Though, many can be found in the sonic-buidimage repo source code (about 17400 lines).
Also no dedicated linter to address this issue can be found in the SONiC Azure CI.
The text was updated successfully, but these errors were encountered: