-
-
Notifications
You must be signed in to change notification settings - Fork 7
feat: add merge_base
to check the branch is rebased
#192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
da1bf27
feat: check merge base (WIP)
shenxianpeng 4a46848
feat: check merge base (WIP)
shenxianpeng f7aacc1
ci: auto fixes from pre-commit.com hooks
pre-commit-ci[bot] ec2c791
fix pre-commit check issues
shenxianpeng 00da816
Update commit_check/branch.py
shenxianpeng b6d0e25
Update .commit-check.yml
shenxianpeng ceccc4c
feat: add noxfile.py
shenxianpeng 432434e
ci: auto fixes from pre-commit.com hooks
pre-commit-ci[bot] be6d753
fix pre-commit check
shenxianpeng aacf5b1
Update noxfile.py
shenxianpeng fd7deb8
fix: update merge_base feature
shenxianpeng 9cdecd4
feat: refactor print error message
shenxianpeng 5fb9ac0
fix: update noxfile.py to fix workflow
shenxianpeng a743a2b
fix: update noxfile.py to fix workflow
shenxianpeng 5fe3167
fix: update noxfile.py to fix finding wheel
shenxianpeng 30761bb
fix: update noxfile.py
shenxianpeng f196cb9
test: disable run commit-check
shenxianpeng b3fd87b
fix: revert main.yml
shenxianpeng 1c5df69
ci: auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 2825ff0
Merge branch 'main' into feature/check-rebase
shenxianpeng 4b53208
fix: removed does work test case
shenxianpeng d07ae51
fix: update merge_base regex
shenxianpeng 26438ee
fix: refactor code based on review
shenxianpeng 5b30018
fix: update noxfile.py to fix lint
shenxianpeng 336407d
refactor: update commit-check.yml
shenxianpeng a73238a
test: add test for git_merge_base()
shenxianpeng 8460825
refactor: update util_test.py
shenxianpeng 9a6d794
feat: add new tests
shenxianpeng f04cd23
refactor: update test
shenxianpeng 2081ec1
test: add tests for main and branch
shenxianpeng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,71 @@ | ||
import nox | ||
import glob | ||
|
||
nox.options.reuse_existing_virtualenvs = True | ||
nox.options.reuse_venv = True | ||
nox.options.sessions = ["lint"] | ||
|
||
REQUIREMENTS = { | ||
"dev": "requirements-dev.txt", | ||
"docs": "docs/requirements.txt", | ||
} | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Development Commands | ||
# ----------------------------------------------------------------------------- | ||
|
||
|
||
@nox.session() | ||
def lint(session): | ||
session.install("pre-commit") | ||
# only need pre-commit hook for local development | ||
session.run("pre-commit", "install", "--hook-type", "pre-commit") | ||
if session.posargs: | ||
args = session.posargs + ["--all-files"] | ||
else: | ||
args = ["--all-files", "--show-diff-on-failure"] | ||
|
||
session.run("pre-commit", "run", *args) | ||
|
||
|
||
@nox.session(name="test-hook") | ||
def test_hook(session): | ||
session.install("-e", ".") | ||
session.install("pre-commit") | ||
session.run("pre-commit", "try-repo", ".") | ||
|
||
|
||
@nox.session() | ||
def build(session): | ||
session.run("python3", "-m", "pip", "wheel", "--no-deps", "-w", "dist", ".") | ||
|
||
|
||
@nox.session(name="install-wheel", requires=["build"]) | ||
def install_wheel(session): | ||
whl_file = glob.glob("dist/*.whl") | ||
session.install(str(whl_file[0])) | ||
|
||
|
||
# @nox.session(name="commit-check", requires=["install-wheel"]) | ||
@nox.session(name="commit-check", requires=["install-wheel"]) | ||
def commit_check(session): | ||
session.run( | ||
"commit-check", | ||
"--message", | ||
"--branch", | ||
"--author-email", | ||
) | ||
|
||
|
||
@nox.session(requires=["install-wheel"]) | ||
def coverage(session): | ||
session.run("coverage", "run", "--source", "commit_check", "-m", "pytest") | ||
session.run("coverage", "report") | ||
session.run("coverage", "xml") | ||
|
||
|
||
@nox.session() | ||
def docs(session): | ||
session.install("-e", ".") | ||
session.install("-r", REQUIREMENTS["docs"]) | ||
session.run("sphinx-build", "-E", "-W", "-b", "html", "docs", "_build/html") |
This file contains hidden or 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,4 +1,5 @@ | ||
coverage | ||
nox | ||
pre-commit | ||
pytest | ||
pytest-mock |
This file contains hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.