File tree 2 files changed +14
-8
lines changed
2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 99
99
- name : Checkout target branch to be able to diff
100
100
if : github.event_name == 'pull_request'
101
101
run : |
102
- git fetch --depth=1 origin ${{ github.base_ref }}
102
+ git fetch origin ${{ github.base_ref }}
103
103
echo "DOCSTRING_DIFF_BRANCH=origin/${{ github.base_ref }}" >> $GITHUB_ENV
104
104
105
+ # Fetch entire history for current branch so that `make lint-docstrings`
106
+ # can calculate the proper diff between the branches
107
+ git pull --ff-only --unshallow origin ${{ github.head_ref }}
108
+
105
109
- name : Lint Code 🎎
106
110
run : |
107
111
# If it's not a pull request, $DOCSTRING_DIFF_BRANCH is unset.
Original file line number Diff line number Diff line change @@ -66,14 +66,16 @@ lint:
66
66
poetry run black --check rasa tests
67
67
make lint-docstrings
68
68
69
- BRANCH ?= master # Compare against `master` if no branch was provided
69
+ # Compare against `master` if no branch was provided
70
+ BRANCH ?= master
70
71
lint-docstrings :
71
- # Lint docstrings only against the the diff to avoid too many errors.
72
- # Check only production code. Ignore other flake errors which are captured by `lint`
73
- # Diff of committed changes (shows only changes introduced by your branch)
74
- if [[ -n "$(BRANCH)" ]]; then \
75
- git diff $(BRANCH)...HEAD -- rasa | poetry run flake8 --select D --diff; \
76
- fi
72
+ # Lint docstrings only against the the diff to avoid too many errors.
73
+ # Check only production code. Ignore other flake errors which are captured by `lint`
74
+ # Diff of committed changes (shows only changes introduced by your branch
75
+ ifneq ($(strip $(BRANCH ) ) ,)
76
+ git diff $(BRANCH)...HEAD -- rasa | poetry run flake8 --select D --diff
77
+ endif
78
+
77
79
# Diff of uncommitted changes for running locally
78
80
git diff HEAD -- rasa | poetry run flake8 --select D --diff
79
81
You can’t perform that action at this time.
0 commit comments