git.fiddlerwoaroof.com
Browse code

chore: minor reformatting

Ed Langley authored on 17/04/2020 07:08:00
Showing 5 changed files
... ...
@@ -4,7 +4,7 @@
4 4
 (in-package #:alimenta)
5 5
 
6 6
 (defclass feed-entity ()
7
-  ((title :initarg :title :initform nil :accessor title)  
7
+  ((title :initarg :title :initform nil :accessor title)
8 8
    (link :initarg :link :initform nil :accessor link)
9 9
    (doc :initarg :doc :initform nil :accessor doc)))
10 10
 
... ...
@@ -39,7 +39,7 @@
39 39
    (id :initarg :id :initform nil :accessor id)
40 40
    (links :initform (make-hash-table :test #'equalp) :accessor links)))
41 41
 
42
-(collection-class:define-collection (feed item) (feed-entity) 
42
+(collection-class:define-collection (feed item) (feed-entity)
43 43
   ((description :initarg :description :initform nil :accessor description)
44 44
    (feed-link :initarg :feed-link :initform nil :accessor feed-link)
45 45
    (source-type :initarg :source-type :initform nil :accessor source-type)))
... ...
@@ -131,7 +131,7 @@
131 131
             (error 'type-error "too many arguments")))
132 132
       (let ((type-keyword (make-keyword (string-upcase type))))
133 133
         (when (slot-boundp self 'links)
134
-          (multiple-value-bind (old-link old-link-p) (gethash type-keyword links) 
134
+          (multiple-value-bind (old-link old-link-p) (gethash type-keyword links)
135 135
             (when old-link-p
136 136
               (cerror "Replace Link ~a:~a with ~a:~a" 'duplicate-link-type :old old-link :new href))))
137 137
         (setf (gethash type-keyword links) href)))))
... ...
@@ -190,7 +190,7 @@
190 190
 ;;  (with-accessors ((items items)) feed
191 191
 ;;    (loop for item across (get-items xml-dom type)
192 192
 ;;          do (push (make-item xml-dom type) items)
193
-;;          finally (return items)))) 
193
+;;          finally (return items))))
194 194
 
195 195
 (defun make-feed (&key title link items feed-link description)
196 196
   (make-instance 'feed
... ...
@@ -322,7 +322,7 @@
322 322
               ($ (inline generated-xml) "entry > content" (text) (node)))
323 323
       (should be equal +link+
324 324
               ($ (inline generated-xml) "entry > link" (attr "href") (node)))
325
-      ; TODO: deal with dates . . .
325
+      ;; TODO: deal with dates . . .
326 326
       )))
327 327
 
328 328
 (defun do-test (&optional (test nil))
... ...
@@ -35,13 +35,12 @@
35 35
 (defgeneric slot-tags (self))
36 36
 
37 37
 (defun process-slots-for-data-class (slots)
38
-  (mapcar
39
-    (fw.lu::destructuring-lambda ((slot tag . rest))
40
-      (let ((tag (etypecase tag
41
-                   (symbol (string-downcase tag))
42
-                   (string tag))))
43
-        (list* slot (make-keyword slot) tag rest)))
44
-    (fw.lu:ensure-mapping slots)))
38
+  (mapcar (fw.lu::destructuring-lambda ((slot tag . rest))
39
+            (let ((tag (etypecase tag
40
+                         (symbol (string-downcase tag))
41
+                         (string tag))))
42
+              (list* slot (make-keyword slot) tag rest)))
43
+          (fw.lu:ensure-mapping slots)))
45 44
 
46 45
 (deftest process-slots-for-data-class ()
47 46
   (let ((tc-1 '(a))
... ...
@@ -78,7 +77,3 @@
78 77
          (defmethod %all-slots ((self ,name) format)
79 78
            (pairlis (list ,@(mapcar (fw.lu::alambda (cadr it)) slots))
80 79
                     (list ,@(loop for (slot) in slots collect `(,slot self)))))))))
81
-
82
-
83
-
84
-
... ...
@@ -44,11 +44,11 @@
44 44
   (:use #:cl #:alimenta #:alexandria #:anaphora #:lquery)
45 45
   (:export #:discover-feed))
46 46
 
47
-(defpackage #:alimenta.pull-feed 
47
+(defpackage #:alimenta.pull-feed
48 48
   (:use #:cl #:alimenta #:alexandria #:anaphora #:lquery)
49 49
   (:export #:pull-feed #:fetch-doc-from-url #:fetch-feed-from-url
50 50
            #:fetch-error #:feed-ambiguous #:no-feed #:with-user-agent
51
-	   #:skip-feed)) 
51
+	   #:skip-feed))
52 52
 
53 53
 (defmethod asdf:perform ((o asdf:test-op) (s (eql (asdf:find-system :alimenta))))
54 54
   (asdf:load-system :alimenta)
... ...
@@ -27,10 +27,10 @@
27 27
 
28 28
   (categories "category" :value (get-categories doc  "channel > category"))
29 29
   (text-input "textInput")
30
-  (managing-editor "managingEditor") 
30
+  (managing-editor "managingEditor")
31 31
   (skip-days "skipDays")
32
-  (skip-hours "skipHours") 
33
-  (publication-date "publicationDate" :transform get-date) 
32
+  (skip-hours "skipHours")
33
+  (publication-date "publicationDate" :transform get-date)
34 34
   (last-build-date "lastBuildDate" :transform get-date))
35 35
 
36 36
 (define-data-class rss-item (doc "") (item)
... ...
@@ -106,7 +106,7 @@
106 106
                                 (let-each (:be *)
107 107
                                   (chronicity:parse timestamp)
108 108
                                   (local-time:timestamp- * minute-offset :minute)
109
-                                  (local-time:timestamp- * hour-offset   :hour)))       
109
+                                  (local-time:timestamp- * hour-offset   :hour)))
110 110
                   (pop-token () (setf timestamp
111 111
                                       (subseq timestamp
112 112
                                               0
... ...
@@ -152,7 +152,7 @@
152 152
 	  ($ (inline (make-element "title")) (text title)
153 153
 	     (inline (make-element "link")) (text link)
154 154
 	     (inline (make-element "pubDate")) (text date)
155
-	     (inline (make-element "description")) (text content))    
155
+	     (inline (make-element "description")) (text content))
156 156
 	  (plump-dom:set-attribute
157 157
 	   ($ (inline (make-element "guid")) (text id) (node))
158 158
 	   "isPermaLink"
... ...
@@ -203,7 +203,7 @@
203 203
                       (serialize (parse (or item-content-encoded item-description)) s))))
204 204
          (*tag-dispatchers* *html-tags*))
205 205
     (make-instance 'rss-item
206
-                   :content content   
206
+                   :content content
207 207
                    :date item-date
208 208
                    :doc xml-dom
209 209
                    :id item-guid
... ...
@@ -219,10 +219,10 @@
219 219
           (get-date "Fri, 09 Jan 2016 23:00:00 -0100"))
220 220
   (should be local-time:timestamp=
221 221
           (local-time:parse-timestring "2016-01-09T23:00:00.000000-0100")
222
-          (get-date "Fri, 09 Jan 2016 22:00:00 -0200"))  
222
+          (get-date "Fri, 09 Jan 2016 22:00:00 -0200"))
223 223
   (should be local-time:timestamp=
224 224
           (local-time:parse-timestring "2016-01-09T23:00:00.000000-0100")
225
-          (get-date "Fri, 09 Jan 2016 21:30:00 -0230"))) 
225
+          (get-date "Fri, 09 Jan 2016 21:30:00 -0230")))
226 226
 
227 227
 (defmethod alimenta::-to-feed (xml-dom (type (eql :rss)) &key feed-link)
228 228
   ;; TODO: store feed-link
... ...
@@ -239,4 +239,3 @@
239 239
                      :link doc-link
240 240
                      :description doc-description
241 241
                      :feed-link doc-feed-link))))
242
-