Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
agennadi committed Oct 29, 2024
1 parent 93d729d commit 1df270e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,30 @@ To learn more about Next.js, take a look at the following resources:

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

***
# Black Linter with Pre-Commit Hook
This repository uses Black, the Python code formatter, to enforce code style standards. The pre-commit hook ensures that Black formats Python code before each commit, helping maintain code consistency across the project.

## Prerequisites

- If you haven't already, install pre-commit:
```pip install pre-commit```
- Run the following command to install the pre-commit hooks defined in the configuration file ```.pre-commit-config.yaml```:
```pre-commit install```
This command sets up pre-commit to automatically run Black before each commit.

## Usage
- **Running Black Automatically**: After setup, every time you attempt to commit code, Black will check the staged files and apply formatting if necessary. If files are reformatted, the commit will be stopped, and you’ll need to review the changes before committing again.
- **Bypassing the Hook**: If you want to skip the Black pre-commit hook for a specific commit, use the --no-verify flag with your commit command:
```git commit -m "your commit message" --no-verify```

**Note**: The ```--no-verify``` flag is helpful in cases where you need to make a quick commit without running the pre-commit
checks, but it should be used sparingly to maintain code quality. CI pipeline will fail during ```push``` and ```pull request``` actions if the code is not formatted.
- **Running Black Manually**: If you want to check or format files without committing, you can run:
```black <your-python-file-or-directory>```
- **Running Pre-commit on All Files**: If you want to format all files in the repository, use:
```pre-commit run --all-files```

***
# Docker
This project uses Docker and Docker Compose to run the application, which includes the frontend, backend, and postgres database.
Expand Down

0 comments on commit 1df270e

Please sign in to comment.