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

Restructure CI/CD Pipelines and add pre-commit hooks #476

Merged
merged 7 commits into from
Oct 1, 2024

Conversation

kluge7
Copy link
Contributor

@kluge7 kluge7 commented Oct 1, 2024

This pull request restructures the CI/CD pipelines to focus solely on checking for linting issues, without automatically committing any changes. The key motivation behind this decision is to follow best practices in CI/CD, where:

  • Avoiding Automatic Commits: It’s considered bad practice for pipelines to commit changes because developers may not be aware of what these changes are, leading to confusion or unintended consequences. Additionally, automatic commits from pipelines can clutter the commit history, making it harder to track meaningful changes.

Changes Implemented

  1. CI/CD Pipelines:
  • Pipelines now perform linting and formatting checks only. If any issues are found, the pipeline will fail, but no changes will be automatically committed.
  • This ensures that the responsibility for fixing issues remains with the developer, keeping them in full control of the code changes and maintaining a cleaner commit history.
  1. Pre-Commit Hooks:
  • Introduced pre-commit hooks that enforce code quality checks before the code is committed. These hooks help catch issues early, ensuring consistency in code style and preventing common issues from reaching the CI/CD stage.
  • The pre-commit hooks include formatters (such as black and clang-format) and linters to maintain code style and detect potential issues before commits are made.
  1. Formatter-Related Changes:
  • A significant portion of the changes in this PR result from the newly implemented formatters. These tools (e.g., black for Python and clang-format for C/C++) automatically reformat code to adhere to consistent coding standards.
  • While this PR includes many changes, they are primarily stylistic updates (whitespace, line breaks, etc.) and do not affect the functionality of the code.

@kluge7 kluge7 added refactor Restructures one or more parts of the code Moderate priority Auto DevOps labels Oct 1, 2024
@kluge7 kluge7 requested a review from Andeshog October 1, 2024 17:35
@kluge7 kluge7 self-assigned this Oct 1, 2024
Copy link
Contributor

@Andeshog Andeshog left a comment

Choose a reason for hiding this comment

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

lgtm

@kluge7 kluge7 merged commit fe4077a into develop Oct 1, 2024
6 checks passed
@kluge7 kluge7 deleted the 470-task-set-up-cicd-pipelines-for-c branch October 1, 2024 17:41
@kluge7 kluge7 linked an issue Oct 1, 2024 that may be closed by this pull request
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto DevOps Moderate priority refactor Restructures one or more parts of the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TASK] Set Up CI/CD Pipelines and Pre-Commit Hooks for linting purposes
2 participants