Skip to content

Commit

Permalink
Chore/improve pre commit (#94)
Browse files Browse the repository at this point in the history
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.

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.
  • Loading branch information
mauvehed committed May 29, 2024
2 parents 61efdc6 + 25ad2b7 commit aacc2c3
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 15 deletions.
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# .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:
- 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]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion app/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
<h1> {{ my_ip_is }} </h1>
</center>
</body>
</html>
</html>
21 changes: 10 additions & 11 deletions docs/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Contributor Covenant Code of Conduct

## Our Pledge
Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit aacc2c3

Please sign in to comment.