Skip to content

Commit 5ae1fcb

Browse files
committed
Pre-commit first part
1 parent 9693437 commit 5ae1fcb

29 files changed

+281
-310
lines changed

.github/ISSUE_TEMPLATE/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ body:
1010
label: "Where?"
1111
description: "Provide path from the root of the repository."
1212
placeholder: "mqpy/"
13-
13+
1414
- type: textarea
1515
id: requested_change
1616
attributes:

.github/ISSUE_TEMPLATE/feat.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ body:
1616
attributes:
1717
label: Task Description
1818
description: Provide a clear and concise description of what needs to be done.
19-
placeholder: Describe the problem or proposed solution.
19+
placeholder: Describe the problem or proposed solution.

.github/ISSUE_TEMPLATE/perf.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ body:
1717
label: Area for Performance Improvement
1818
description: Specify the part of the codebase or system that requires optimization. Explain why it needs improvement and describe the current performance issue as the proposed solution.
1919
placeholder: e.g., "The sorting algorithm in module X is slow when handling large datasets."
20-

.github/workflows/deploy-mkdocs.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@ jobs:
2424
uses: astral-sh/setup-uv@v5
2525
with:
2626
python-version: "3.11"
27-
27+
2828
- name: Install the project
2929
run: uv sync --locked --group docs
30-
30+
3131
- name: Build MkDocs
3232
run: mkdocs build --site-dir ./deploy
33-
33+
3434
- name: Setup Pages
3535
uses: actions/configure-pages@v4
36-
36+
3737
- name: Upload artifact
3838
uses: actions/upload-pages-artifact@v3
3939
with:
4040
path: './deploy'
41-
41+
4242
- name: Deploy to GitHub Pages
4343
id: deployment
4444
uses: actions/deploy-pages@v4

.github/workflows/deploy-semantic-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
with:
2222
github_token: ${{ secrets.GITHUB_TOKEN }}
2323
push: "true"
24-
changelog: "true"
24+
changelog: "true"

.github/workflows/test-metatrader5-integration.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,28 @@ on:
99
jobs:
1010
test:
1111
runs-on: windows-latest
12-
12+
1313
steps:
1414
- uses: actions/checkout@v4
15-
15+
1616
- name: Set up Python
1717
uses: actions/setup-python@v4
1818
with:
1919
python-version: '3.11'
20-
20+
2121
- name: Download MetaTrader 5
2222
run: |
2323
Invoke-WebRequest -Uri "https://download.mql5.com/cdn/web/metaquotes.software.corp/mt5/mt5setup.exe" -OutFile mt5setup.exe
24-
24+
2525
- name: Install MetaTrader 5 silently
2626
run: |
2727
Start-Process -FilePath .\mt5setup.exe -ArgumentList "/auto" -Wait
28-
28+
2929
- name: Install Python dependencies
3030
run: |
3131
python -m pip install --upgrade pip
3232
pip install MetaTrader5
33-
33+
3434
- name: Test MetaTrader5 connection
3535
run: |
3636
python tests/integration/test_mt5_connection.py

.github/workflows/test-pre-commit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ jobs:
1717
- name: Run Pre-commit
1818
uses: pre-commit/action@v3.0.1
1919
with:
20-
extra_args: --all-files
20+
extra_args: --all-files

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
.env
2-
*.pyc
2+
*.pyc

.pre-commit-config.yaml

Lines changed: 67 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,72 @@
1+
default_language_version:
2+
python: python3
13
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.5.0
4-
hooks:
5-
- id: trailing-whitespace
6-
- id: end-of-file-fixer
7-
- id: check-yaml
8-
- id: check-added-large-files
9-
language_version: python3
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v5.0.0
6+
hooks:
7+
- id: check-added-large-files
8+
- id: check-ast
9+
- id: check-builtin-literals
10+
- id: check-byte-order-marker
11+
- id: check-case-conflict
12+
- id: check-docstring-first
13+
- id: check-executables-have-shebangs
14+
- id: check-json
15+
- id: check-merge-conflict
16+
- id: check-shebang-scripts-are-executable
17+
- id: check-symlinks
18+
- id: check-yaml
19+
- id: debug-statements
20+
- id: destroyed-symlinks
21+
- id: end-of-file-fixer
22+
- id: file-contents-sorter
23+
- id: trailing-whitespace
1024

25+
- repo: https://github.com/astral-sh/ruff-pre-commit
26+
rev: v0.8.6
27+
hooks:
28+
- id: ruff
29+
args: [--fix, --exit-non-zero-on-fix]
30+
- id: ruff-format
1131

32+
- repo: https://github.com/codespell-project/codespell
33+
rev: v2.3.0
34+
hooks:
35+
- id: codespell
36+
language: python
37+
types: [text]
38+
entry: codespell --ignore-words=.codespell-ignore --check-filenames
39+
exclude: uv.lock
1240

13-
- repo: https://github.com/psf/black
14-
rev: 23.11.0
15-
hooks:
16-
- id: black
17-
args: [--safe, --line-length=120]
41+
- repo: https://github.com/pre-commit/mirrors-mypy
42+
rev: v1.14.1
43+
hooks:
44+
- id: mypy
45+
name: mypy
46+
pass_filenames: false
47+
args:
48+
[
49+
--strict-equality,
50+
--disallow-untyped-calls,
51+
--disallow-untyped-defs,
52+
--disallow-incomplete-defs,
53+
--disallow-any-generics,
54+
--check-untyped-defs,
55+
--disallow-untyped-decorators,
56+
--warn-redundant-casts,
57+
--warn-unused-ignores,
58+
--no-warn-no-return,
59+
--warn-unreachable,
60+
]
61+
additional_dependencies: ["types-requests", "types-PyYAML"]
1862

19-
- repo: https://github.com/pycqa/isort
20-
rev: 5.12.0
21-
hooks:
22-
- id: isort
23-
args: [--profile=black]
63+
- repo: local
64+
hooks:
65+
- id: pylint
66+
name: pylint
67+
entry: pylint
68+
language: python
69+
additional_dependencies: ["pylint"]
70+
types: [python]
71+
args: ["--disable=all", "--enable=missing-docstring,unused-argument"]
72+
exclude: 'test_\.py$'

docs/assets/favicon.svg

Lines changed: 7 additions & 7 deletions
Loading

docs/assets/logo-icon.svg

Lines changed: 8 additions & 8 deletions
Loading

docs/assets/logo.svg

Lines changed: 11 additions & 11 deletions
Loading

docs/extra.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,11 +377,11 @@
377377
display: none !important;
378378
}
379379

380-
/* Hide all first h1 headers - typically module names */
380+
/* Hide all first h1 headers - typically module names */
381381
h1:first-of-type {
382382
display: none !important;
383383
}
384-
body > div.md-container > main > div > div.md-sidebar.md-sidebar--secondary > div > div > nav > ul > li:nth-child(1) > a > span {
384+
body > div.md-container > main > div > div.md-sidebar.md-sidebar--secondary > div > div > nav > ul > li:nth-child(1) > a > span {
385385
display: none !important;
386386
}
387387

@@ -585,4 +585,4 @@
585585
.md-typeset .md-button {
586586
margin-top: 0.5em;
587587
margin-right: 0.5em;
588-
}
588+
}

docs/extra.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function cleanupClipboardText(targetSelector) {
5151
// Create popup container
5252
const popup = document.createElement('div');
5353
popup.className = 'sponsor-popup';
54-
54+
5555
// Create popup content
5656
popup.innerHTML = `
5757
<div class="sponsor-popup-content">
@@ -76,26 +76,26 @@ function cleanupClipboardText(targetSelector) {
7676
</div>
7777
</div>
7878
`;
79-
79+
8080
// Add popup to body
8181
document.body.appendChild(popup);
82-
82+
8383
// Show popup with animation
8484
setTimeout(() => {
8585
popup.classList.add('active');
8686
}, 1000);
87-
87+
8888
// Close button event
8989
const closeBtn = popup.querySelector('.sponsor-popup-close');
9090
closeBtn.addEventListener('click', () => {
9191
popup.classList.remove('active');
92-
92+
9393
// Check if "don't show again" is checked
9494
const dontShowAgain = document.getElementById('sponsor-popup-dont-show').checked;
9595
if (dontShowAgain) {
9696
localStorage.setItem('mqpy_sponsor_popup_shown', 'true');
9797
}
98-
98+
9999
// Remove popup after animation
100100
setTimeout(() => {
101101
popup.remove();
@@ -111,4 +111,4 @@ function cleanupClipboardText(targetSelector) {
111111
document$.subscribe(function () {
112112
setCopyText();
113113
showSponsorPopup();
114-
});
114+
});

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
!!! sponsor "Support MQPy Development"
66
MQPy is a free and open-source project that needs your support to continue development!
7-
7+
88
[💛 Become a Sponsor](https://github.com/sponsors/Joaopeuko){ .md-button .md-button--primary }
99

1010
# MQPy

0 commit comments

Comments
 (0)