mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Find the common ancestor for the style checking
This allows the style checker to only look at the changes done in the current branch, and not the other commits that were done in the base branch.
This commit is contained in:
parent
51483c2ff1
commit
b235637713
2
.github/workflows/style.yml
vendored
2
.github/workflows/style.yml
vendored
|
@ -23,5 +23,5 @@ jobs:
|
|||
- name: Check style
|
||||
run: |
|
||||
clang-format -version
|
||||
scripts/fix_style.py --dry-run --base "$(git merge-base origin/master $GITHUB_SHA)"
|
||||
scripts/fix_style.py --dry-run --base origin/master
|
||||
scripts/check_header_guards.py
|
||||
|
|
|
@ -43,6 +43,8 @@ def warn(changed_lines):
|
|||
result = subprocess.call(["clang-format", "-Werror", "--dry-run"] + ["--lines={}:{}".format(start, end) for start, end in changed_lines[filename]] + [filename]) or result
|
||||
return result
|
||||
|
||||
def get_common_base(base):
|
||||
return subprocess.check_output(["git", "merge-base", "HEAD", base]).decode().strip()
|
||||
|
||||
def main():
|
||||
import argparse
|
||||
|
|
Loading…
Reference in a new issue