mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-26 15:56:00 +03:00
[PR #12] [MERGED] Implement pre-commit hooks #534
Labels
No labels
a/b
bug
documentation
enhancement
good first issue
help wanted
invalid
pull-request
question
wontfix
yt-error
yt-update
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ytmusicapi#534
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/sigma67/ytmusicapi/pull/12
Author: @st-den
Created: 5/12/2020
Status: ✅ Merged
Merged: 5/15/2020
Merged by: @sigma67
Base:
master← Head:dev📝 Commits (2)
d8ea95bImplement pre-commit hooksb142cf3Format the code with YAPF📊 Changes
8 files changed (+228 additions, -97 deletions)
View changed files
➕
.flake8(+10 -0)➕
.pre-commit-config.yaml(+9 -0)➕
.style.yapf(+5 -0)📝
tests/test.py(+18 -9)📝
ytmusicapi/helpers.py(+7 -9)📝
ytmusicapi/parsers.py(+42 -19)📝
ytmusicapi/setup.py(+4 -2)📝
ytmusicapi/ytmusic.py(+133 -58)📄 Description
Now the following checks have to be passed before committing:
YAPF hook check:
Formats the staged files. If staged version differs from the correctly formatted version, the file is formatted correctly and the changes become unstaged, so the developer could review them.
Flake8 hook check:
Lints the staged files. If staged file had linting errors, pre-commit yields those errors and the changes become unstaged, so the developer could fix them.
If both checks were passed, commit is made.
Checks can be made explicitly with
pre-commit run.I set up YAPF and Flake8, so that the code looked good enough, mostly. Also, I adjusted the settings a little, so that the code in its current state passed the checks. Though almost all of Flake8 ignore settings are considered sane defaults, nevertheless. Line length 99 is recommended by PEP as one of options.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.