diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 0000000..6e3c7d8 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,2 @@ +# Run pre-commit hooks for commit-msg stage +pre-commit run --hook-stage commit-msg --commit-msg-filename "$1" diff --git a/.husky/pre-commit b/.husky/pre-commit index 7f1e6bd..d8f48dd 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,13 +1,12 @@ # Lint FE code -echo "Formatting and linting FE code" +echo "Formatting and linting FE code..." pnpm exec lint-staged # Capture list of staged files STAGED_FILES=$(git diff --name-only --cached) - # Format BE code -echo "Formatting BE code" -pre-commit run +echo "Formatting BE code..." +pre-commit run --all-files -echo "Committing changes" \ No newline at end of file +# You may want to consider also running `pre-commit autoupdate` periodically to keep hooks updated. \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 38c8d6c..ea253cf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,20 +1,35 @@ -files: '^java/.*java' repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v6.0.0 hooks: - id: check-merge-conflict - id: end-of-file-fixer + files: '^(java/.*\.java|py.*\.py)$' - id: trailing-whitespace + files: '^(java/.*\.java|py.*\.py)$' - id: mixed-line-ending args: ['--fix=auto'] + files: '^(java/.*\.java|py.*\.py)$' - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks rev: v2.15.0 hooks: - id: pretty-format-java args: [--autofix, --google-java-formatter-version=1.28.0] + files: '^java/.*\.java$' - repo: https://github.com/commitizen-tools/commitizen rev: v3.10.0 hooks: - id: commitizen stages: [commit-msg] + - repo: https://github.com/psf/black + rev: 23.9.1 + hooks: + - id: black + language_version: python3 + files: '^py.*\.py$' + - repo: https://github.com/pycqa/isort + rev: 5.12.0 + hooks: + - id: isort + args: ['--profile', 'black'] + files: '^py.*\.py$' diff --git a/README.md b/README.md index 7810ea2..bee60f6 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,13 @@ This repository includes several tools to help maintain code quality: - [ESLint](https://eslint.org/docs/latest/use/core-concepts/): Checks your front-end code for quality and common errors. - [pre-commit](https://pre-commit.com/): Ensures code formatting and quality checks are run before committing (primarily for back-end code). - [lint-staged](https://github.com/okonet/lint-staged): Runs Prettier and ESLint on staged files before each commit to prevent bad code from being pushed. + - Note: if you are a Mac user, and your commits are erroring out with the message `" not foundECURSIVE_EXEC_FIRST_FAIL  Command "lint-staged`, then you likely need to change your line-endings in `./husky/pre-commit` and `./husky/commit-msg` from CRLF to LF. +- [commitizen](https://www.conventionalcommits.org/en/v1.0.0/): This pre-commit hook uses conventional commit syntax. Check this link out to understand how to format your commit messages. Here are some common examples: + - `feat: Major feature added` + - `docs: Documentation changed/updated` + - `fix: Bug fixed and code restored to working state` + - `refactor(style): Changed some code around to adhere to better style` + - `chore: Some update/chore that you've been needing to do` --- diff --git a/client/src/pages/HomePage.tsx b/client/src/pages/HomePage.tsx index bd6f329..d9301cc 100644 --- a/client/src/pages/HomePage.tsx +++ b/client/src/pages/HomePage.tsx @@ -1,8 +1,36 @@ +import { useLoadingPixel } from '@/hooks'; +import { Stack, Typography } from '@mui/material'; + /** * Renders the home page. * * @component */ export const HomePage = () => { - return