Skip to content

Commit 8b4ee29

Browse files
Merge pull request #29 from jeFF0Falltrades/precommit-formatting
Adds pre-commit hook and bumps version for next release
2 parents 7c62937 + fcc0de9 commit 8b4ee29

File tree

7 files changed

+62
-5
lines changed

7 files changed

+62
-5
lines changed

.github/workflows/precommit.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Pre-Commit Checks
2+
3+
on: push
4+
5+
jobs:
6+
pre-commit:
7+
name: Run Pre-Commit Hooks
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout Repository
12+
uses: actions/checkout@v4
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.13"
18+
19+
- name: Install pre-commit
20+
run: pip install pre-commit
21+
22+
- name: Run pre-commit hooks
23+
run: pre-commit run --all-files

.pre-commit-config.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.11.2
4+
hooks:
5+
- id: ruff
6+
args:
7+
- "--fix"
8+
- "--exclude"
9+
- "pyproject.toml"
10+
language_version: python3

README.md

+22-1
Original file line numberDiff line numberDiff line change
@@ -562,9 +562,30 @@ $ rat-king-parser -n dangerzone/* | jq
562562
]
563563
```
564564

565+
566+
567+
## Development Guide
568+
**More Verbose Guide To Be Published**
569+
570+
### Development Dependencies
571+
572+
RKP uses `pre-commit` to enforce formatting.
573+
574+
To begin development and install `pre-commit`, use the following command:
575+
576+
```bash
577+
pip install .[dev]
578+
```
579+
580+
Then, ensure you install the pre-commit hook:
581+
582+
```bash
583+
pre-commit install
584+
```
585+
565586
## Feedback, Issues, and Additions
566587

567-
If you have suggestions for improvement, bugs, feedback, or additional RAT families that use a similar configuration format as AsyncRAT, QuasarRAT, VenomRAT, DcRAT, etc. that are not yet supported, please send me a message on [Mastodon](https://infosec.exchange/@jeFF0Falltrades), [YouTube](https://www.youtube.com/c/jeff0falltrades), or submit an Issue or PR in this repo.
588+
If you have suggestions for improvement, bugs, feedback, or additional RAT families that use a similar configuration format as AsyncRAT, QuasarRAT, VenomRAT, DcRAT, etc. that are not yet supported, please send me a message on [Bluesky](https://bsky.app/profile/jeff0falltrades.bsky.social), [YouTube](https://www.youtube.com/c/jeff0falltrades), or submit an Issue or PR in this repo.
568589

569590
Also, if this tool or video tutorial was helpful to you, that's always nice to hear as well!
570591

pyproject.toml

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ classifiers = [
3636
]
3737
dynamic = [ "version" ]
3838
dependencies = [ "dnfile", "pycryptodomex", "yara-python" ]
39-
39+
optional-dependencies.dev = [ "pre-commit" ]
4040
optional-dependencies.maco = [ "maco", "validators" ]
4141
urls."Bug Reports" = "https://github.com/jeFF0Falltrades/rat_king_parser/issues"
4242
urls."Homepage" = "https://github.com/jeFF0Falltrades/rat_king_parser"
@@ -56,3 +56,6 @@ namespaces = false
5656

5757
[tool.ruff]
5858
lint.extend-select = [ "I" ]
59+
60+
[tool.pre-commit]
61+
hook-config = "file:.pre-commit-config.yaml"

src/rat_king_parser/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2424
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2525
# SOFTWARE.
26-
__version__ = "4.0.2"
26+
__version__ = "4.1.0"

src/rat_king_parser/config_parser/utils/decryptors/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2525
# SOFTWARE.
2626
from .config_decryptor import ConfigDecryptor, IncompatibleDecryptorException
27-
from .config_decryptor_aes_with_iv_pbkdf2 import ConfigDecryptorAESWithIV_pbkdf
2827
from .config_decryptor_aes_with_iv import ConfigDecryptorAESWithIV
28+
from .config_decryptor_aes_with_iv_pbkdf2 import ConfigDecryptorAESWithIV_pbkdf
2929
from .config_decryptor_decrypt_xor import ConfigDecryptorDecryptXOR
3030
from .config_decryptor_ecb import ConfigDecryptorECB
3131
from .config_decryptor_plaintext import ConfigDecryptorPlaintext

src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_aes_with_iv_bpkdf2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# SOFTWARE.
2828
import re
2929
from base64 import b64decode
30-
from logging import getLogger, DEBUG
30+
from logging import getLogger
3131

3232
from Cryptodome.Cipher import AES
3333
from Cryptodome.Cipher.AES import MODE_CBC as CBC

0 commit comments

Comments
 (0)