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

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

Closed
2 of 5 tasks
kluge7 opened this issue Sep 29, 2024 · 0 comments · Fixed by #476 or #467
Closed
2 of 5 tasks

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

kluge7 opened this issue Sep 29, 2024 · 0 comments · Fixed by #476 or #467
Assignees

Comments

@kluge7
Copy link
Contributor

kluge7 commented Sep 29, 2024

Description of task

The goal of this task is to restructure and configure Continuous Integration (CI) pipelines and set up pre-commit hooks to ensure that code adheres to established linting and formatting standards without automatically committing any changes. This will involve modifying the current pipelines to run checks for code quality, style, and potential security issues while ensuring that the developer is fully aware of the necessary changes without automatically applying them.

The task aims to maintain clean, readable, and consistent code across the project while preventing clutter in the commit history and ensuring that developers are in control of all code changes.

Specifications

  • CI/CD Pipelines:

  • Objective: Set up pipelines that check for code formatting and linting issues without automatically fixing or committing those changes.

  • Key Linting/Formatting Tools:
    -- Black (Python code formatting)
    -- isort (Python import sorting)
    -- clang-format (C/C++ formatting)
    -- pylint (Python linting)
    -- mypy (Python type checking)
    -- bandit (Security analysis)

  • Pipeline Behavior:
    -- The pipelines should only fail if there are issues, with a clear message prompting the developer to fix them locally.
    -- No auto-committing should take place to maintain a clean commit history.

  • Fail Criteria:
    -- Any discrepancies in code style, linting issues, or security vulnerabilities will fail the pipeline.

  • Pre-Commit Hooks:

  • Objective: Add pre-commit hooks to ensure that code follows standards before being committed.

  • Pre-Commit Hooks to be set up:
    -- Black: Enforce Python formatting.
    -- isort: Ensure sorted imports.
    -- codespell: Spell check code comments and documentation.
    -- clang-format: Check C/C++ code formatting.
    -- Pylint: Lint Python code.
    -- Mypy: Enforce type checking in Python.
    -- Bandit: Run security checks.
    -- Standard Hooks: End-of-file-fixer, trailing whitespace removal, and mixed-line-ending checks.

Contacts

  • DevOps (Auto)

Code Quality

  • Every function in header files are documented (inputs/returns/exceptions)
  • The project has automated tests that cover MOST of the functions and branches in functions (pytest/gtest)
  • The code is documented on the wiki (provide link)
@kluge7 kluge7 self-assigned this Sep 29, 2024
@kluge7 kluge7 linked a pull request Oct 1, 2024 that will close this issue
@kluge7 kluge7 changed the title [TASK] Set Up CI/CD Pipelines for C++ [TASK] Set Up CI/CD Pipelines and Pre-Commit Hooks for linting purposes Oct 1, 2024
@kluge7 kluge7 closed this as completed Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment