From f932da4590e126e62d13df268d58d00f64cbff04 Mon Sep 17 00:00:00 2001
From: Moul <moul@moul.re>
Date: Sun, 4 Jun 2023 15:31:57 +0200
Subject: [PATCH] Introduce pre-commit-hooks hook (#202)

Apply changes
---
 .pre-commit-config.yaml       | 10 ++++++++++
 CHANGELOG.md                  | 12 ++++++------
 tests/key/test_ascii_armor.py |  2 +-
 tests/key/test_signing_key.py |  4 ++--
 4 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index ae67494..edbb946 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,5 +1,15 @@
 exclude: ^docs/
 repos:
+- repo: https://github.com/pre-commit/pre-commit-hooks
+  rev: v4.4.0
+  hooks:
+    - id: check-ast
+    - id: check-merge-conflict
+    - id: check-toml
+    - id: debug-statements
+    - id: end-of-file-fixer
+    - id: mixed-line-ending
+    - id: trailing-whitespace
 -   repo: https://github.com/psf/black
     rev: 23.3.0
     hooks:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 365c137..1148c28 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -64,11 +64,11 @@ The methods to check the signature·s have been moved as specific methods into t
   - All `Document` subclasses can be directly signed when the optional `signing_key` argument is passed
   - #172 `version` argument is now optional and have a proper default value per document type
   - `currency` argument is now optional and defaults to `G1_CURRENCY_CODENAME`
-    
+
         signing_key: SigningKey = None,
         version: int = VERSION,
         currency: str = G1_CURRENCY_CODENAME,
-    
+
   - Introduce `Identity.from_bma_lookup_response()` to simplify examples
   - Refactor `Document.signatures` `List` as `Document.signature` `str`
   - `VerifyingKey.verify_document()` has been removed in favour of `Document.check_signature(pubkey)`
@@ -84,12 +84,12 @@ The methods to check the signature·s have been moved as specific methods into t
 - #175, !155: Rename `timestamp` and `blockstamp` attributes and arguments depending on their content:
   - `timestamp` for time in seconds
   - `block_id` for `BlockID` type
-  - `BlockUID` has been renamed to `BlockID` and `BlockID.block_uid()` to `get_block_id()` 
-  
+  - `BlockUID` has been renamed to `BlockID` and `BlockID.block_uid()` to `get_block_id()`
+
 - #163, !137: `Revocation.from_signed_raw()` now stores the block ID into a `BlockID` object
 
 #### Network
-The asynchronous property has been dropped to improve DuniterPy accessibility to new comers. 
+The asynchronous property has been dropped to improve DuniterPy accessibility to new comers.
 Improvements have been made on the endpoints handling.
 
 - #140, !118: Replace `aiohttp` with non-asynchronous `http` and `ws` libraries: `urllib` and `websocket-client`:
@@ -235,7 +235,7 @@ Improvements have been made on the endpoints handling.
 
 ### Documentation
 - #104 add CONTRIBUTE.md file with release workflow
- 
+
 ### CI/CD
 - #66, !93  Migrate to [Poetry](https://python-poetry.org/) (build and development environment)
 
diff --git a/tests/key/test_ascii_armor.py b/tests/key/test_ascii_armor.py
index 1e18de9..eae4b49 100644
--- a/tests/key/test_ascii_armor.py
+++ b/tests/key/test_ascii_armor.py
@@ -39,7 +39,7 @@ Hello world !
 Héhé ;-)
 
 This is a utf-8 message...
-       
+
        """
         # create encrypted and signed ascii armor message
         encrypted_and_signed_aa_message = AsciiArmor.create(
diff --git a/tests/key/test_signing_key.py b/tests/key/test_signing_key.py
index 5fa6cc3..26ee0fc 100644
--- a/tests/key/test_signing_key.py
+++ b/tests/key/test_signing_key.py
@@ -115,14 +115,14 @@ class TestSigningKey(unittest.TestCase):
         # comments
         #
         #
-        
+
         {
             "curve": "ed25519",
             "public": "dGVzdHRlc3R0ZXN0dGV0c3RldHN0dGV0c3RldGV0ZXRldHN0ZXR0c3RldHN0dGV0c3Q=.ed25519",
             "private": "dGVzdHRlc3R0ZXN0dGV0c3RldHN0dGV0c3RldGV0ZXRldHN0ZXR0c3RldHN0dGV0c3Q==.ed25519",
             "id": "@qJ8qVfXU2mIWG9WfKIRsd6GDscQlErzPHsxzHcyQMWQ=.ed25519"
         }
-        
+
         #
         # comments
         """
-- 
GitLab