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

Added a pre-commit config file and reformatted all the files accordingly using it. #77

Closed
wants to merge 8 commits into from
Closed

Added a pre-commit config file and reformatted all the files accordingly using it. #77

wants to merge 8 commits into from

Conversation

Sai-Suraj-27
Copy link
Contributor

What type of PR is this?

Reformating/Refactoring:

Added a basic pre-commit configuration file (.pre-commit-config.yaml ) to the codebase as it helps improve the code quality and maintain consistency within the project. It will allow all the developers/future contributors to maintain a consistent code style. Many Python-based repositories use a .pre-commit-config.yaml.
I have also refactored some code to make it more readable and clean. For example: In many places, an f-string could have been used but it was not used, So I used f-strings in those places. In some places, if conditions could be merged but they were not, So, I merged them.

What this PR does / why we need it:
Adding a pre-commit configuration file (.pre-commit-config.yaml ) to the codebase helps improve the code quality and maintain consistency within the project. It will allow all the developers/future contributors to maintain a consistent code style. Adding this will help us by running some automated checks (The checks mentioned below) before anyone tries to make a commit. This will help in maintaining consistency throughout the codebase.

I have added the following pre-commit hooks:

  1. trailing-whitespace (Removes trailing whitespace at the end of lines)
  2. end-of-file-fixer (Ensures that files end with a newline character)
  3. check-yaml (Validates YAML files for syntax errors and potential issues)
  4. black (code formatter that automatically applies a consistent code style to your Python code).

hsj576 and others added 6 commits July 20, 2023 13:07
Signed-off-by: hsj576 <sjhu21@m.fudan.edu.cn>
Signed-off-by: Sai-Suraj-27 <sai.suraj.27.729@gmail.com>
Signed-off-by: hsj576 <sjhu21@m.fudan.edu.cn>
Signed-off-by: Sai-Suraj-27 <sai.suraj.27.729@gmail.com>
Signed-off-by: hsj576 <sjhu21@m.fudan.edu.cn>
Signed-off-by: Sai-Suraj-27 <sai.suraj.27.729@gmail.com>
Signed-off-by: hsj576 <sjhu21@m.fudan.edu.cn>
Signed-off-by: Sai-Suraj-27 <sai.suraj.27.729@gmail.com>
…gly by using it.

Signed-off-by: Sai-Suraj-27 <sai.suraj.27.729@gmail.com>
Signed-off-by: Sai-Suraj-27 <sai.suraj.27.729@gmail.com>
@kubeedge-bot
Copy link
Collaborator

@Sai-Suraj-27: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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

Successfully merging this pull request may close these issues.

3 participants