Skip to content

Commit

Permalink
Merge branch 'master' of github.com:wandersoncferreira/github-review …
Browse files Browse the repository at this point in the history
…into wip-inline-comments
  • Loading branch information
wandersoncferreira committed Oct 10, 2021
2 parents 9d17613 + 7390f49 commit 6a9e34f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 16 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
name: CI

on: [push]

on : [push, pull_request]
jobs:
build:
runs-on: [ubuntu-latest]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run CI in docker
run: docker run -v $(pwd):/opt silex/emacs:27.1-ci-cask bash -c "cd /opt && make ci"
- uses: actions/checkout@v1
- uses: actions/setup-python@v2
- uses: purcell/setup-emacs@master
with:
version: '27.1'
- uses: conao3/setup-cask@master
with:
version: 'snapshot'

- name: Run tests
run: make test
18 changes: 13 additions & 5 deletions github-review.el
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,10 @@ ACC is an alist accumulating parsing state."
(erase-buffer)
(insert diff)
(save-buffer)
(github-review-mode)))
(github-review-mode)
;; Use `C-c C-c' in diff-mode to go to source code
(setq default-directory forge-current-dir)
(goto-char (point-min))))

(defun github-review-parsed-review-from-current-buffer ()
"Return a code review given the current buffer containing a diff."
Expand Down Expand Up @@ -608,10 +611,15 @@ Github API provides only the originalPosition in the query.")
(interactive)
(let* ((pullreq (or (forge-pullreq-at-point) (forge-current-topic)))
(repo (forge-get-repository pullreq)))
(github-review-start-internal (a-alist 'owner (oref repo owner)
'repo (oref repo name)
'apihost (oref repo apihost)
'num (oref pullreq number)))))

(if (not (forge-pullreq-p pullreq))
(message "We can only review PRs at the moment. You tried on something else.")
(progn
(setq forge-current-dir default-directory)
(github-review-start-internal (a-alist 'owner (oref repo owner)
'repo (oref repo name)
'apihost (oref repo apihost)
'num (oref pullreq number)))))))

;;;###autoload
(defun github-review-start (url)
Expand Down
5 changes: 1 addition & 4 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
.PHONY: ci local test
ci:
cask upgrade-cask
cask install
cask exec buttercup -L test/github-review-test.el

test:
cask install
cask exec buttercup -L test/github-review-test.el

# Run the tests locally
Expand Down

0 comments on commit 6a9e34f

Please sign in to comment.