Skip to content

Commit

Permalink
#7 why
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Jul 1, 2024
1 parent 10c717c commit 8679982
Showing 1 changed file with 12 additions and 78 deletions.
90 changes: 12 additions & 78 deletions rules/basic.fe
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,6 @@
return r
')

(explain (when
(exists what)
(or
(eq what 'events-were-scanned')
(eq what 'labels-were-scanned')
(eq what 'bug-was-accepted')
(eq what 'bug-was-resolved')
(eq what 'comment-was-posted')
(eq what 'git-was-pushed')
(eq what 'events-were-scanned')
(eq what 'issue-was-closed')
(eq what 'issue-was-opened')
(eq what 'issue-was-assigned')
(eq what 'label-was-attached')
(eq what 'release-published')
(eq what 'reward-for-bug-reported')
(eq what 'reward-for-resolved-bug')
(eq what 'tag-was-created'))))

(explain (when
(exists what)
(matches what "^[a-z]+(-[a-z]+)*$")))
Expand All @@ -56,7 +37,7 @@
(exists details)
(and
(not (matches details " "))
(not (matches details "^.{,120}$"))
(not (matches details "^.{,80}$"))
(not (matches details "[^.]$")))))

(explain (when
Expand All @@ -68,20 +49,24 @@
(explain (when
(exists _version)
(eq "String" (type _version))))
(explain (when
(exists why)
(eq "String" (type why))))
(explain (when
(exists issue)
(and
(eq "Integer" (type issue))
(gt issue 0))))
(explain (when
(exists repository)
(eq "Integer" (type repository))))
(and
(eq "Integer" (type repository))
(gt repository 0))))
(explain (when
(exists who)
(eq "Integer" (type who))))
(explain (when
(exists award)
(eq "Integer" (type award))))
(and
(eq "Integer" (type who))
(gt who 0))))

(explain (when
(exists when)
Expand All @@ -94,65 +79,14 @@
(explain (when
(exists award)
(and
(eq "Integer" (type award))
(exists when)
(exists who)
(exists reason))))
(exists why))))

(explain (when
(eq what 'events-were-scanned')
(and
(exists repository)
(exists latest)
(eq "Integer" (type latest)))))

(explain (when
(eq what 'label-was-attached')
(and
(exists issue)
(exists label)
(eq "String" (type label)))))

(explain (when
(eq what 'issue-was-opened')
(and
(exists issue)
(exists when)
(exists who))))

(explain (when
(eq what 'issue-was-closed')
(and
(exists issue)
(exists when)
(exists who))))

(explain (when
(eq what 'bug-was-resolved')
(and
(exists cause)
(exists when)
(exists issue)
(exists details)
(exists who))))

(explain (when
(eq what 'bug-was-accepted')
(and
(exists cause)
(exists when)
(exists issue)
(exists details)
(exists reporter)
(eq "Integer" (type reporter))
(exists who))))

(explain (when
(eq what 'bug-report-was-rewarded')
(and
(exists cause)
(exists award)
(eq "Integer" (type award))
(exists when)
(exists issue)
(exists repository))))

0 comments on commit 8679982

Please sign in to comment.