-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- format.yml for online check. - .pre-commit-config.yaml for commit check.
- Loading branch information
1 parent
9171a0a
commit c5b44e8
Showing
19 changed files
with
303 additions
and
170 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,44 @@ | ||
name: format | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
types: [opened, synchronize, reopened] | ||
|
||
env: | ||
CHECK_FILES: >- | ||
flagscale/auto_tuner/*.py | ||
flagscale/auto_tuner/prune/*.py | ||
flagscale/auto_tuner/record/*.py | ||
flagscale/auto_tuner/search/*.py | ||
flagscale/launcher/*.py | ||
flagscale/logger.py | ||
flagscale/patches_utils.py | ||
flagscale/datasets/sft_dataset.py | ||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install black isort | ||
- name: Run Black | ||
run: >- | ||
black --check --diff --include $CHECK_FILES ./ | ||
- name: Run Isort | ||
run: | | ||
isort --profile black --check --diff $CHECK_FILES | ||
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
check_files: &check_files | | ||
(?x)^( | ||
flagscale/auto_tuner/.*\.py| | ||
flagscale/auto_tuner/prune/\..*\.py| | ||
flagscale/auto_tuner/record/\..*\.py| | ||
flagscale/auto_tuner/search/\..*\.py| | ||
flagscale/launcher/\..*\.py| | ||
flagscale/logger\.py| | ||
flagscale/patches_utils\.py| | ||
flagscale/datasets/sft_dataset\.py | ||
)$ | ||
|
||
repos: | ||
- repo: local | ||
hooks: | ||
- id: black | ||
name: black | ||
entry: black | ||
language: system | ||
types: [python] | ||
files: *check_files | ||
- id: isort | ||
name: isort | ||
entry: isort | ||
language: system | ||
types: [python] | ||
files: *check_files | ||
args: ["--profile", "black"] |
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
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import logging | ||
import os | ||
import re | ||
import logging | ||
import subprocess | ||
|
||
import pandas as pd | ||
|
||
|
||
|
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
Oops, something went wrong.