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

Fix #1380, Light coding standards cleanup #1381

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thnkslprpt
Copy link
Contributor

@thnkslprpt thnkslprpt commented Apr 14, 2023

Checklist

Describe the contribution

  • Fixes Light coding standards cleanup #1380
    • Light clean-up for some 'easy wins' to improve compliance with some of the rules common to the relevant coding standards:
      • split up multiple declarations on a single line
      • remove redundant definitions (i.e. values that are not used before the variable is assigned a new value)
      • remove trailing whitespace in yaml files
      • add braces to single line if/else blocks
      • remove side-effects from statements where no refactoring or new variables are needed. For example:
        image

Testing performed
GitHub CI actions all passing successfully.

Expected behavior changes
No change to behavior.

This PR will:

  • improve clarity & consistency
  • improve compliance with rules common to all/most of the relevant coding standards
  • reduce technical debt and ease future maintenance
  • result in cleaner builds with fewer alerts/warnings from code scanners

Contributor Info
Avi Weiss @thnkslprpt

@@ -97,23 +99,31 @@
uint32 i;
uint32 j;

if ((fp = fopen(Filename, "w")))
fp = fopen(Filename, "w");

Check failure

Code scanning / CodeQL

File created without restricting permissions

A file may be created here with mode 0666, which would make it world-writable.
@@ -55,7 +55,9 @@
{
FILE *fp;

if ((fp = fopen(Filename, "w")))
fp = fopen(Filename, "w");

Check failure

Code scanning / CodeQL

File created without restricting permissions

A file may be created here with mode 0666, which would make it world-writable.
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.

Light coding standards cleanup
2 participants