Commit c99725a4 authored by Ayres, Andrew's avatar Ayres, Andrew
Browse files

Merge branch 'Fix_solution_formatting' into 'main'

Fixed formatting in solutions section

See merge request !18
parents 9a1a1bf1 876aeeb0
Loading
Loading
Loading
Loading
Loading
+26 −25
Original line number Diff line number Diff line
@@ -132,11 +132,11 @@ The template comes with a basic test suite using `pytest`. Navigate to the `nova
## **Explore Pre-Commit Hooks**

The template includes pre-commit hooks for code formatting and linting.

*   **Inspect the Configuration:** Open the `.pre-commit-config.yaml` file.  What tools are configured to run? What does each tool do (e.g., `black`, `flake8`)?
*   **Try It Out:**  Make a deliberate formatting error in one of the Python files (e.g., add extra spaces, make a line too long).  Now, run `pre-commit run`. Observe how the pre-commit hooks automatically fix the formatting issues. Commit your changes.  Pre-commit hooks can also be automatically run upon git commit.

:::::::::::::::  solution

*   **What tools are configured to run?** Open `.pre-commit-config.yaml` to see the list. Common tools include:
    *   `black`: Auto-formats Python code to adhere to a consistent style.
    *   `flake8`: Lints Python code, checking for style errors and potential bugs.
@@ -153,6 +153,7 @@ The template includes pre-commit hooks for code formatting and linting.
## **CI/CD Setup with GitLab CI**

The template includes a basic GitLab CI configuration file (`.gitlab-ci.yml`).  While we won\'t fully execute a CI/CD pipeline in this tutorial step, let\'s understand its purpose.

*   **Examine the Configuration:** Open the `.gitlab-ci.yml` file.  This file defines the *pipeline*.  What are the key stages defined in the pipeline (e.g., build, test, deploy)?  Identify the jobs that install dependencies, run tests, and perform linting. What triggers the pipeline to run (e.g., pushes, merge requests)?
*   **GitLab Runner:** GitLab CI/CD uses *runners* to execute the jobs defined in your `.gitlab-ci.yml` file.  These runners can be configured in various ways.  (No action required; this is just an informational point.)
*   **Discussion:** If you were to push this project to a GitLab repository, what would happen when you create a merge request? How could you use CI/CD to automatically verify the code quality of your project? (No action required; this is a thought exercise.)