From e9c3c6e648d04181cff4dbd9b5716431613389b7 Mon Sep 17 00:00:00 2001 From: mauvehed Date: Wed, 29 May 2024 16:04:16 -0500 Subject: [PATCH 1/3] feat: add pre-commit configuration file A pre-commit configuration file has been added to the project to automate the process of checking for common issues before commits. This includes checks for trailing whitespace, file formatting, and preventing commits to the main branch. It also includes checks for potential security leaks using Gitleaks and code formatting using Prettier. This will help maintain code quality and prevent potential issues from being committed to the repository. --- .pre-commit-config.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..c9053df --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,25 @@ +# .pre-commit-config.yaml +# +exclude: '(\..*\.y[a]?ml|\.github/workflows)' +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: no-commit-to-branch + args: ['--branch', 'main'] # prevent local commits to main branch + - id: end-of-file-fixer + - id: trailing-whitespace + - id: check-yaml + - id: check-json + - id: check-toml + - id: check-ast + - id: debug-statements + - repo: https://github.com/gitleaks/gitleaks + rev: v8.18.2 + hooks: + - id: gitleaks + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v4.0.0-alpha.8 + hooks: + - id: prettier + types_or: [json, toml, yaml, markdown] From 92452e63debd7ed6c756444e960bc1fdd0527180 Mon Sep 17 00:00:00 2001 From: mauvehed Date: Wed, 29 May 2024 16:06:00 -0500 Subject: [PATCH 2/3] docs(README.md): remove extra space in paragraph for better readability style(index.html): add newline at end of file to adhere to best practices style(CODE_OF_CONDUCT.md): remove unnecessary leading spaces for better readability docs(CONTRIBUTING.md): remove unnecessary blank lines for cleaner code The changes were made to improve the readability and cleanliness of the code and documentation. The extra space in the README.md file was removed to enhance readability. A newline was added at the end of the index.html file to adhere to best practices. Unnecessary leading spaces were removed from the CODE_OF_CONDUCT.md file for better readability. Lastly, unnecessary blank lines were removed from the CONTRIBUTING.md file to make the code cleaner. --- README.md | 2 +- app/templates/index.html | 2 +- docs/CODE_OF_CONDUCT.md | 21 ++++++++++----------- docs/CONTRIBUTING.md | 2 -- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 4f7cc99..63cc3cd 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ the website and what format your ask for the IP address to be returned in. ### Issues and feature requests -You've found a bug in the source code, a mistake in the documentation or maybe you'd like a new feature? You can help us by [submitting an issue on GitHub](https://github.com/mauvehed/yourip/issues). Before you create an issue, make sure to search the issue archive -- your issue may have already been addressed! +You've found a bug in the source code, a mistake in the documentation or maybe you'd like a new feature? You can help us by [submitting an issue on GitHub](https://github.com/mauvehed/yourip/issues). Before you create an issue, make sure to search the issue archive -- your issue may have already been addressed! Please try to create bug reports that are: diff --git a/app/templates/index.html b/app/templates/index.html index fb01e6f..16be884 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -12,4 +12,4 @@

{{ my_ip_is }}

- \ No newline at end of file + diff --git a/docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md index 9769ba6..68f1d4c 100644 --- a/docs/CODE_OF_CONDUCT.md +++ b/docs/CODE_OF_CONDUCT.md @@ -1,4 +1,3 @@ - # Contributor Covenant Code of Conduct ## Our Pledge @@ -18,23 +17,23 @@ diverse, inclusive, and healthy community. Examples of behavior that contributes to a positive environment for our community include: -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience -* Focusing on what is best not just for us as individuals, but for the overall +- Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: -* The use of sexualized language or imagery, and sexual attention or advances of +- The use of sexualized language or imagery, and sexual attention or advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email address, +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a +- Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 929dfcd..e37d35f 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -73,8 +73,6 @@ docker compose -f docker-compose.yml -f docker-compose.debug.yml up -d This command uses both docker-compose.yml and docker-compose.debug.yml to start the container in detached mode with development settings. - - ## Running Tests We use pytest for testing. To run tests: From 25ad2b77e41a2257ad30b50044c5b6b058974187 Mon Sep 17 00:00:00 2001 From: mauvehed Date: Wed, 29 May 2024 16:52:24 -0500 Subject: [PATCH 3/3] Update .pre-commit-config.yaml Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c9053df..fd8b3c4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,6 @@ # .pre-commit-config.yaml +# This file contains the configuration for pre-commit hooks. +# Each hook helps maintain code quality by running automated checks before commits. # exclude: '(\..*\.y[a]?ml|\.github/workflows)' repos: