Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig: https://EditorConfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

indent_style = space
indent_size = 2
tab_width = 2

[*.py]
indent_style = space
indent_size = 4

[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Normalize line endings.
* text=auto eol=lf
13 changes: 9 additions & 4 deletions .github/workflows/pylint.yml → .github/workflows/lint-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,23 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.10", "3.12"]
steps:
- uses: actions/checkout@v3

- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install stock-indicators==1.2.1
pip install stock-indicators==1.3.1
pip install pylint

- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
35 changes: 16 additions & 19 deletions .github/workflows/lint-pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Pull request"
name: Pull request

on:
pull_request_target:
Expand All @@ -14,6 +14,7 @@ jobs:
main:
name: lint PR title
runs-on: ubuntu-latest

steps:
- uses: amannn/action-semantic-pull-request@v5
id: lint_pr_title
Expand All @@ -29,9 +30,8 @@ jobs:
# the default error message that is shown when the pattern doesn't match.
# The variables `subject` and `title` can be used within the message.
subjectPatternError: >
The subject "**{subject}**" found in the pull request title "*{title}*"
didn't match the configured pattern. Please ensure that the subject
starts with an uppercase character.
The subject "**{subject}**" in pull request "*{title}*"
needs to start with an uppercase character.

# If the PR contains one of these newline-delimited labels, the
# validation is skipped. If you want to rerun the validation when
Expand All @@ -47,25 +47,22 @@ jobs:
if: always() && (steps.lint_pr_title.outputs.error_message != null)
with:
header: pr-title-lint-error
message: >
### Hey there and thank you for opening this pull request! 👋🏼

It looks like your proposed **_Pull request title_** needs to be adjusted.

>🚩 **Error** » ${{ steps.lint_pr_title.outputs.error_message }}
message: |
### ⚠️ Pull Request title needs adjustment

#### Pull request title naming convention
Your PR title doesn't match our naming convention: `type: Subject`

Our PR title name taxonomy is `type: Subject`, where **type** is typically
*feat*, *fix*, or *chore*, and **subject** is a phrase (proper noun) that starts
with a capitalized letter. The *chore* type usually has a subject that starts
with an action verb like *Add* or *Update*. Examples:
> [!CAUTION]
> ${{ steps.lint_pr_title.outputs.error_message }}

- _feat: Admin portal login_
- _fix: Divide by zero bug in SMA_
- _chore: Update packages_
- _docs: Improve setup guidance_
#### Valid examples

- `feat: Add new RSI indicator`
- `fix: Correct MACD calculation`
- `chore: Update documentation`
- `test: Add unit tests for EMA`
- `refactor: Optimize moving average logic`

See the [Conventional Commits specification](https://www.conventionalcommits.org) for more information.

# Delete a previous comment when the issue has been resolved
Expand Down
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"recommendations": [
"donjayamanne.python-extension-pack",
"ms-dotnettools.vscode-dotnet-runtime",
"ms-python.black-formatter",
"ms-python.debugpy",
"ms-python.isort",
"ms-python.pylint",
"ms-python.python",
"ms-python.vscode-pylance"
]
}
16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": "always", // default: "never"
"source.organizeImports": "always" // default: "never"
},
"editor.formatOnSave": true, // default: false

"isort.args": ["--profile", "black"], // default: []
"isort.importStrategy": "fromEnvironment", // default: "useBundled"

"pylint.importStrategy": "fromEnvironment", // default: "useBundled"

"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter" // default: null
}
}
Loading
Loading