Skip to content

Commit 0dd3263

Browse files
style: apply melpazoid style suggestions
1 parent b829089 commit 0dd3263

File tree

8 files changed

+60
-36
lines changed

8 files changed

+60
-36
lines changed

.github/workflows/melpazoid.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# melpazoid <https://github.com/riscy/melpazoid> build checks.
2+
3+
# If your package is on GitHub, enable melpazoid's checks by copying this file
4+
# to .github/workflows/melpazoid.yml and modifying RECIPE and EXIST_OK below.
5+
6+
name: melpazoid
7+
on: [push, pull_request]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Set up Python 3.10
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.10'
18+
- name: Install
19+
run: |
20+
python -m pip install --upgrade pip
21+
sudo apt-get install emacs && emacs --version
22+
git clone https://github.com/riscy/melpazoid.git ~/melpazoid
23+
pip install ~/melpazoid
24+
- name: Run
25+
env:
26+
LOCAL_REPO: ${{ github.workspace }}
27+
# RECIPE is your recipe as written for MELPA:
28+
RECIPE: (jira :fetcher github :repo "unmonoqueteclea/jira.el")
29+
# set this to false (or remove it) if the package isn't on MELPA:
30+
EXIST_OK: false
31+
run: echo $GITHUB_REF && make -C ~/melpazoid

jira-actions.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
(,(concat "--comment=" (jira-utils-marked-item)
7171
": " (jira-actions--marked-issue-description))
7272
,(concat "--date="
73-
(format-time-string "%Y-%m-%dT%H:%M:%S.%3N%z" (current-time)))
73+
(format-time-string "%FT%T.%3N%z" (current-time)))
7474
"--time=1h"))
7575
["Arguments"
7676
("n" "Notify users" "--notify-users")

jira-api.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@
9696
(cl-defun jira-api-call (verb endpoint &key params data callback)
9797
"Perform a VERB request to the Jira API ENDPOINT.
9898
99-
PARAMS is a list of cons cells, DATA is the request body, and CALLBACK is the function to call if successful."
99+
PARAMS is a list of cons cells, DATA is the request body, and CALLBACK
100+
is the function to call if successful."
100101
(message "[Jira API Call]: %s %s" verb endpoint)
101102
(let ((auth (jira-api--auth-header jira-username jira-token)))
102103
(request

jira-detail.el

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -70,24 +70,18 @@
7070
(ratio (jira-detail--issue-fmt issue :work-ratio))
7171
(fix-versions (jira-detail--issue-fmt issue :fix-versions))
7272
(summary (jira-detail--issue-fmt issue :summary)))
73-
(insert (concat (jira-detail--header "Issue Key")
74-
key " (" type")\n"))
75-
(insert (concat (jira-detail--header "Status")
76-
status))
73+
(insert (jira-detail--header "Issue Key") key " (" type")\n")
74+
(insert (jira-detail--header "Status") status)
7775
(if (and resolution (not (string= resolution "")))
78-
(insert (concat " (" resolution ")\n"))
76+
(insert " (" resolution ")\n")
7977
(insert "\n"))
80-
(insert (concat (jira-detail--header "Project")
81-
project "\n"))
82-
(insert (concat (jira-detail--header "Time")
83-
estimate
84-
" (remaining: " remaining ")\n"))
85-
(insert (concat (jira-detail--header "Work Ratio")
86-
ratio "\n"))
87-
(insert (concat (jira-detail--header "Fix Versions")
88-
fix-versions "\n"))
89-
(insert (concat (jira-detail--header "Summary")
90-
summary "\n"))))
78+
(insert (jira-detail--header "Project") project "\n")
79+
(insert (jira-detail--header "Time")
80+
estimate
81+
" (remaining: " remaining ")\n")
82+
(insert (jira-detail--header "Work Ratio") ratio "\n")
83+
(insert (jira-detail--header "Fix Versions") fix-versions "\n")
84+
(insert (jira-detail--header "Summary") summary "\n")))
9185

9286

9387
(defun jira-detail--issue-team (issue)
@@ -98,11 +92,11 @@
9892
(parent-status (jira-detail--issue-fmt issue :parent-status))
9993
(sprint (jira-detail--issue-fmt issue :sprints))
10094
(components (jira-detail--issue-fmt issue :components)))
101-
(insert (concat (jira-detail--header "Business Line") line "\n"))
102-
(insert (concat (jira-detail--header "Parent")
103-
parent-key " (" parent-type ") (" parent-status ")\n"))
104-
(insert (concat (jira-detail--header "Sprint") sprint "\n"))
105-
(insert (concat (jira-detail--header "Components") components "\n"))))
95+
(insert (jira-detail--header "Business Line") line "\n")
96+
(insert (jira-detail--header "Parent")
97+
parent-key " (" parent-type ") (" parent-status ")\n")
98+
(insert (jira-detail--header "Sprint") sprint "\n")
99+
(insert (jira-detail--header "Components") components "\n")))
106100

107101
(defun jira-detail--issue-manager-data (issue)
108102
"Show the manager data of the ISSUE."
@@ -112,12 +106,12 @@
112106
(assignee (jira-detail--issue-fmt issue :assignee-name))
113107
(reporter (jira-detail--issue-fmt issue :reporter-name))
114108
(due-date (jira-detail--issue-fmt issue :due-date)))
115-
(insert (concat (jira-detail--header "Cost Center") cost-center "\n"))
116-
(insert (concat (jira-detail--header "Priority") priority "\n"))
117-
(insert (concat (jira-detail--header "Labels") labels "\n"))
118-
(insert (concat (jira-detail--header "Assignee") assignee "\n"))
119-
(insert (concat (jira-detail--header "Reporter") reporter "\n"))
120-
(insert (concat (jira-detail--header "Due Date") due-date "\n"))))
109+
(insert (jira-detail--header "Cost Center") cost-center "\n")
110+
(insert (jira-detail--header "Priority") priority "\n")
111+
(insert (jira-detail--header "Labels") labels "\n")
112+
(insert (jira-detail--header "Assignee") assignee "\n")
113+
(insert (jira-detail--header "Reporter") reporter "\n")
114+
(insert (jira-detail--header "Due Date") due-date "\n")))
121115

122116
(defun jira-detail--description (issue)
123117
"Show the description of the ISSUE."

jira-fmt.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ COLOR-TODAY is a boolean to color the date if it is today."
102102
(when (not (string-empty-p date))
103103
(let ((value (concat date ", " (jira-utils-get-day-of-week date))))
104104
(if (and color-today
105-
(string= date (format-time-string "%Y-%m-%d" (current-time))))
105+
(string= date (format-time-string "%F" (current-time))))
106106
(propertize value 'face 'jira-face-date-today)
107107
(propertize value 'face 'jira-face-date)))))
108108

jira-issues.el

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,11 @@
212212

213213
(setq tabulated-list-sort-key (cons "Status" nil))
214214
(setq tabulated-list-padding 2)
215-
(add-hook 'tabulated-list-revert-hook 'jira-issues--refresh nil t)
215+
(add-hook 'tabulated-list-revert-hook #'jira-issues--refresh nil t)
216+
(add-hook 'jira-issues-changed-hook #'tablist-revert)
216217
(tabulated-list-init-header)
217218
(tablist-minor-mode))
218219

219-
(add-hook 'jira-issues-changed-hook 'tablist-revert)
220-
221220
(provide 'jira-issues)
222221

223222
;;; jira-issues.el ends here

jira-tempo.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ CALLBACK is a function that will be called with the worklogs data."
168168
(list (funcall name field) (funcall columns field) t))
169169
jira-tempo-table-fields))))
170170
(setq tabulated-list-padding 2)
171-
(add-hook 'tabulated-list-revert-hook 'jira-tempo--refresh nil t)
171+
(add-hook 'tabulated-list-revert-hook #'jira-tempo--refresh nil t)
172172
(tabulated-list-init-header)
173173
(tablist-minor-mode)
174174
(tabulated-list-revert)

jira-utils.el

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ with the given PREFIX."
169169
(days-from-monday (mod (- current-day 1) 7))
170170
(start-of-week (time-subtract date (days-to-time days-from-monday)))
171171
(end-of-week (time-add start-of-week (days-to-time 6)))
172-
(format-time (lambda (time)
173-
(format-time-string "%Y-%m-%d" time))))
172+
(format-time (lambda (time) (format-time-string "%F" time))))
174173
(list (funcall format-time start-of-week)
175174
(funcall format-time end-of-week))))
176175

0 commit comments

Comments
 (0)