mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-23 21:11:08 +00:00
Add GitHub action for pre-commit (#2515)
* Add GitHub action file for pre-commit * Fix errors exposed by pre-commit hook: - Remove executable bit from files without shebang. I checked those file and it was not needed. - Fix with black * Apply suggestions from code review Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
parent
ae65f55de3
commit
acaeb22bbd
15
.github/workflows/pre-commit.yml
vendored
Normal file
15
.github/workflows/pre-commit.yml
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
name: pre-commit
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
pre-commit:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
- name: Install pre-commit
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install --upgrade pre-commit
|
||||
- run: pre-commit run --verbose --all-files --show-diff-on-failure
|
0
machine_learning/scoring_functions.py
Executable file → Normal file
0
machine_learning/scoring_functions.py
Executable file → Normal file
0
maths/sum_of_arithmetic_series.py
Executable file → Normal file
0
maths/sum_of_arithmetic_series.py
Executable file → Normal file
0
scheduling/round_robin.py
Executable file → Normal file
0
scheduling/round_robin.py
Executable file → Normal file
|
@ -15,7 +15,7 @@ def extract_user_profile(script) -> dict:
|
|||
May raise json.decoder.JSONDecodeError
|
||||
"""
|
||||
data = script.contents[0]
|
||||
info = json.loads(data[data.find('{"config"'): -1])
|
||||
info = json.loads(data[data.find('{"config"') : -1])
|
||||
return info["entry_data"]["ProfilePage"][0]["graphql"]["user"]
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user