Skip to content

Commit

Permalink
Correct lint error in build and remove <br> in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kvanbere committed Jan 12, 2018
1 parent ee1968a commit dbbb3dd
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ trim_trailing_whitespace = true
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false # needed for <br/>-like breaks

[*.hs, *.lhs]
charset = utf-8
indent_size = 4
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![github-webhooks Mascot](./doc/github-webhooks-mascot-248.svg)<br/>
![github-webhooks Mascot](./doc/github-webhooks-mascot-248.svg)
github-webhooks
---------------

Expand Down Expand Up @@ -47,11 +47,11 @@ eitherDecode' json :: Either String WatchEvent
```

Some practical integration examples are also provided:
* [Servant Integration (Simple)](./examples/servant-simple#readme)<br/>
* [Servant Integration (Simple)](./examples/servant-simple#readme)
Minimal working example of integrating this package with [servant] and [servant-github-webhook].
* [Servant Integration (Typical)](./examples/servant-adv#readme)<br/>
* [Servant Integration (Typical)](./examples/servant-adv#readme)
This example demonstrates more advanced use-cases with [servant] by decoding multiple different types of payloads on the same endpoint.
* [Scotty Integration](./examples/scotty#readme)<br/>
* [Scotty Integration](./examples/scotty#readme)
Minimal working example of integrating this package with [scotty].

## Changelog
Expand Down
4 changes: 2 additions & 2 deletions examples/servant-simple/src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ type IssueCommentHookAPI
:> Post '[JSON] ()

issueCommentHook :: RepoWebhookEvent -> ((), IssueCommentEvent) -> Handler ()
issueCommentHook _ ev =
liftIO . putStrLn $ (show . whIssueCommentBody . evIssueCommentPayload . snd) ev
issueCommentHook _ ev = liftIO $
print $ (show . whIssueCommentBody . evIssueCommentPayload . snd) ev

main :: IO ()
main = do
Expand Down
4 changes: 2 additions & 2 deletions examples/servant/src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type PushHookAPI
pushHook :: RepoWebhookEvent -> ((), PushEvent) -> Handler ()
pushHook _ (_, ev) = liftIO $ do
putStrLn $ (show . whUserLogin . evPushSender) ev ++ " pushed a commit causing HEAD SHA to become:"
putStrLn $ (show . fromJust . evPushHeadSha) ev
print $ (fromJust . evPushHeadSha) ev

-- Issue Comment Hook

Expand All @@ -38,7 +38,7 @@ type IssueCommentHookAPI
issueCommentHook :: RepoWebhookEvent -> ((), IssueCommentEvent) -> Handler ()
issueCommentHook _ (_, ev) = liftIO $ do
putStrLn "An issue comment was posted:"
putStrLn $ (show . whIssueCommentBody . evIssueCommentPayload) ev
print $ (whIssueCommentBody . evIssueCommentPayload) ev

-- Combine Handlers

Expand Down
12 changes: 9 additions & 3 deletions github-webhooks.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
--
-- see: https://github.com/sol/hpack
--
-- hash: 83b636769db28062ff2e3fe32da99c50cdecac5126424a868592c3d32145f869
-- hash: 5615459135d4ff74ceec05176fb1708f3f5c7b50dd4184b4d462e62af6bbdb17

name: github-webhooks
version: 0.9.0
synopsis: Support for GitHub webhook payloads.
description: Complete instances for decoding (using @aeson@) and interpreting webhook payloads from the GitHub API.
synopsis: Aeson instances for GitHub Webhook payloads.
description: Complete instances for decoding GitHub Webhook payloads (using @aeson@). See the README at <https://github.com/onrock-eng/github-webhooks#readme> for examples.
category: GitHub
homepage: https://github.com/onrock-eng/github-webhooks#readme
bug-reports: https://github.com/onrock-eng/github-webhooks/issues
author: Kyle Van Berendonck <kyle.vanberendonck@onrock.engineering>
Expand All @@ -18,6 +19,11 @@ license-file: LICENSE
build-type: Simple
cabal-version: >= 1.10

extra-source-files:
CHANGELOG.md
package.yaml
stack.yaml

source-repository head
type: git
location: https://github.com/onrock-eng/github-webhooks
Expand Down
12 changes: 10 additions & 2 deletions package.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
name: github-webhooks
version: 0.9.0

category: GitHub
license: MIT
synopsis: Support for GitHub webhook payloads.
description: Complete instances for decoding (using @aeson@) and interpreting webhook payloads from the GitHub API.
extra-source-files:
- package.yaml
- stack.yaml
- CHANGELOG.md
synopsis: Aeson instances for GitHub Webhook payloads.
copyright: (c) 2017-2018 OnRock Engineering
author: Kyle Van Berendonck <kyle.vanberendonck@onrock.engineering>
maintainer: Kyle Van Berendonck <foss@onrock.engineering>
github: onrock-eng/github-webhooks
description:
Complete instances for decoding GitHub Webhook payloads (using @aeson@).
See the README at <https://github.com/onrock-eng/github-webhooks#readme> for examples.

ghc-options:
- -Wall
Expand Down

0 comments on commit dbbb3dd

Please sign in to comment.