-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c28b90d
commit 578fb4d
Showing
4 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Manual Refactor | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run-refactor: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: setup git config | ||
run: | | ||
# setup the username and email. I tend to use 'GitHub Actions Bot' with no email by default | ||
git config user.name "Upsonic Refactor Bot" | ||
git config user.email "<[email protected]>" | ||
- name: Run Refactor Script | ||
run: | | ||
python refactor.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ | |
|
||
from .tests.test_system import Prompt_As_Test_System | ||
|
||
__version__ = '0.2.0' | ||
__version__ = '0.2.0' # fmt: skip | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import os | ||
|
||
|
||
def install_refactor_tool(): | ||
os.system("pip install ruff==0.6.0") | ||
|
||
|
||
def refactor(): | ||
os.system("ruff check --fix") | ||
os.system("ruff format") | ||
|
||
|
||
def create_commit(): | ||
os.system("git add .") | ||
os.system("git commit -m 'refactor: Scheduled refactoring'") | ||
|
||
|
||
def push(): | ||
os.system("git push") | ||
|
||
|
||
if __name__ == "__main__": | ||
install_refactor_tool() | ||
refactor() | ||
create_commit() | ||
push() |