diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2ab8b3d..a71ead5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,12 +12,10 @@ repos: - id: pretty-format-json - id: mixed-line-ending - # - repo: https://github.com/astral-sh/ruff-pre-commit - # rev: v0.1.6 - # hooks: - # - id: ruff - # args: [--fix] - # - id: ruff-format + - repo: https://github.com/Yelp/detect-secrets + rev: v1.4.0 + hooks: + - id: detect-secrets - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. diff --git a/README.md b/README.md index 57806ae..898756c 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,168 @@ - Ruff for linting - MyPy for type checking - uses a custom Python script to check for secrets + +## Setup + +`git clone https://github.com/Python-Test-Engineer/gha-python.git` + +`uv sync` - installs dependencies + +`uv run pytest -vs` - runs pytest to check all wired OK. You can remove files from `src` and `tests` to add your own files. + +`uv run pre-commit install --hook-type commit-msg` sets up precommit and conventional commits + +Test: + +`git add .` + +`git commit -m "will not work"` - this will fail + +`git commit -m "docs: update README with setup instructions"` - this will pass as if follows conventional commits. + + +# Conventional Commits Guide + +Conventional Commits is a specification for adding human and machine-readable meaning to commit messages. It provides a simple set of rules for creating an explicit commit history. + +TIPS: + +feat/fix or breaking changes will create Semantic Versioning bumps. + +To avoid this use 'docs/chore/perf/style/test/refactor' prefixes as these will idicate what you are doing without affecting versioning which can be saved for deployment push. + +## Basic Format + +``` +[optional scope]: + +[optional body] + +[optional footer(s)] +``` + +## Types + +**feat**: A new feature for the user +``` +feat: add user authentication +feat(auth): implement password reset +``` + +**fix**: A bug fix +``` +fix: resolve login validation error +fix(api): handle null response in user endpoint +``` + +**docs**: Documentation only changes +``` +docs: update README installation steps +docs(api): add authentication examples +``` + +**style**: Changes that don't affect code meaning (white-space, formatting, etc.) +``` +style: fix indentation in components +style(css): remove unused imports +``` + +**refactor**: Code change that neither fixes a bug nor adds a feature +``` +refactor: simplify user validation logic +refactor(utils): extract common date formatting +``` + +**perf**: A code change that improves performance +``` +perf: optimize database queries +perf(images): implement lazy loading +``` + +**test**: Adding missing tests or correcting existing tests +``` +test: add unit tests for user service +test(auth): cover edge cases in login flow +``` + +**build**: Changes that affect the build system or external dependencies +``` +build: update webpack configuration +build(deps): bump lodash from 4.17.20 to 4.17.21 +``` + +**ci**: Changes to CI configuration files and scripts +``` +ci: add automated testing workflow +ci(github): update deployment pipeline +``` + +**chore**: Other changes that don't modify src or test files +``` +chore: update .gitignore +chore(release): bump version to 1.2.0 +``` + +## Breaking Changes + +Add `!` after the type/scope to indicate breaking changes: +``` +feat!: remove deprecated API endpoints +feat(auth)!: change password requirements +``` + +Or use the footer: +``` +feat: add new authentication method + +BREAKING CHANGE: old auth tokens are no longer valid +``` + +## Examples + +**Simple feature:** +``` +feat: add dark mode toggle +``` + +**Bug fix with scope:** +``` +fix(checkout): prevent duplicate order submissions +``` + +**Documentation update:** +``` +docs: add contributing guidelines +``` + +**Breaking change:** +``` +feat!: upgrade to Node.js 18 + +BREAKING CHANGE: Node.js 16 is no longer supported +``` + +**With body and footer:** +``` +feat(lang): add French language support + +Add complete French translations for all user-facing text +including error messages and form labels. + +Closes #123 +``` + +## Benefits + +- Automatically generating changelogs +- Automatically determining semantic version bumps +- Communicating changes to teammates and stakeholders +- Triggering build and publish processes +- Making it easier to explore a more structured commit history + +## Tips + +- Use the imperative mood ("add" not "added" or "adds") +- Keep the description under 50 characters when possible +- Use the body to explain what and why vs. how +- Reference issues and pull requests in the footer \ No newline at end of file diff --git a/README_HOW_I_SET_UP.md b/README_CRAIG_NOTES.md similarity index 98% rename from README_HOW_I_SET_UP.md rename to README_CRAIG_NOTES.md index d94cd83..ecb127b 100644 --- a/README_HOW_I_SET_UP.md +++ b/README_CRAIG_NOTES.md @@ -30,6 +30,8 @@ v2.1.0 v3.0.0 - has the `ci.yaml` OK +v3.1.0 - has the detect-secrets precommit as gitleaks did not seem to work. Tested with `ci.yaml` + -------------------------------------------------------------------- # Set up diff --git a/TEST.md b/TEST.md new file mode 100644 index 0000000..88ae434 --- /dev/null +++ b/TEST.md @@ -0,0 +1,13 @@ +`git clone https://github.com/Python-Test-Engineer/gha-python.git` + +`uv sync` + +`uv run pytest -vs` + +`uv run pre-commit install --hook-type commit-msg` sets up precommit and conventional commits + +`git add .` + +`git commit -m "will not work"` + +`git commit -m "docs: update README with setup instructions"` \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 8f5ea9a..dc13a6f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gha-python" -version = "2.1.0" +version = "3.0.0" description = "Add your description here" readme = "README.md" requires-python = ">=3.10" diff --git a/uv.lock b/uv.lock index 0e23606..c0850cf 100644 --- a/uv.lock +++ b/uv.lock @@ -61,7 +61,7 @@ wheels = [ [[package]] name = "gha-python" -version = "0.1.0" +version = "3.0.0" source = { virtual = "." } dependencies = [ { name = "mypy" }, pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy