Skip to content

Commit 1b80983

Browse files
Prepare 0.1.0.0 release.
Reformatted. Use new .github workflows. Removed unused deps. Updated package metadata.
1 parent 880a560 commit 1b80983

File tree

12 files changed

+488
-344
lines changed

12 files changed

+488
-344
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@byteverse/l3c

.github/workflows/build.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: build
2+
on:
3+
pull_request:
4+
branches:
5+
- "*"
6+
7+
jobs:
8+
call-workflow:
9+
uses: byteverse/.github/.github/workflows/build-matrix.yaml@main
10+
with:
11+
cabal-file: syslog.cabal

.github/workflows/release.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: release
2+
on:
3+
push:
4+
tags:
5+
- "*"
6+
7+
jobs:
8+
call-workflow:
9+
uses: byteverse/.github/.github/workflows/release.yaml@main
10+
secrets: inherit

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.vscode/
12
dist
23
dist-*
34
cabal-dev

CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Revision history for syslog
22

3-
## 0.1.0.0 -- YYYY-mm-dd
3+
## 0.1.0.0 -- 2024-02-14
44

5-
* First version. Released on an unsuspecting world.
5+
* First version.

Setup.hs

-2
This file was deleted.

examples/validate.hs

+19-18
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
1-
{-# language BangPatterns #-}
2-
{-# language LambdaCase #-}
1+
{-# LANGUAGE BangPatterns #-}
2+
{-# LANGUAGE LambdaCase #-}
33

4-
import Data.Primitive (ByteArray)
5-
import Data.ByteString (ByteString)
6-
import Data.Bool (bool)
74
import Control.Exception
8-
import System.IO.Error (isEOFError)
5+
import Data.Bool (bool)
6+
import Data.ByteString (ByteString)
7+
import Data.Primitive (ByteArray)
98
import Foreign.C.Types (CChar)
9+
import System.IO.Error (isEOFError)
1010

11-
import qualified Data.Primitive as PM
12-
import qualified Data.Primitive.Ptr as PM
1311
import qualified Data.ByteString as ByteString
1412
import qualified Data.Bytes as Bytes
13+
import qualified Data.Primitive as PM
14+
import qualified Data.Primitive.Ptr as PM
1515
import qualified Syslog.Bsd as Bsd
1616

1717
main :: IO ()
1818
main = do
19-
let go !ix = catchJust (bool Nothing (Just ()) . isEOFError) (Just <$> ByteString.getLine) (\() -> pure Nothing) >>= \case
20-
Nothing -> pure ()
21-
Just b0 -> do
22-
b1 <- b2b b0
23-
case Bsd.decode (Bytes.fromByteArray b1) of
24-
Nothing -> fail $ "Decode failure on line " ++ show ix
25-
Just r -> do
26-
print r
27-
go (ix + 1)
19+
let go !ix =
20+
catchJust (bool Nothing (Just ()) . isEOFError) (Just <$> ByteString.getLine) (\() -> pure Nothing) >>= \case
21+
Nothing -> pure ()
22+
Just b0 -> do
23+
b1 <- b2b b0
24+
case Bsd.decode (Bytes.fromByteArray b1) of
25+
Nothing -> fail $ "Decode failure on line " ++ show ix
26+
Just r -> do
27+
print r
28+
go (ix + 1)
2829
go 0
2930

3031
b2b :: ByteString -> IO ByteArray
31-
b2b !b = ByteString.useAsCStringLen b $ \(ptr,len) -> do
32+
b2b !b = ByteString.useAsCStringLen b $ \(ptr, len) -> do
3233
arr <- PM.newByteArray len
3334
PM.copyPtrToMutablePrimArray (castArray arr) 0 ptr len
3435
PM.unsafeFreezeByteArray arr

fourmolu.yaml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Number of spaces per indentation step
2+
indentation: 2
3+
4+
# Max line length for automatic line breaking
5+
column-limit: 200
6+
7+
# Styling of arrows in type signatures (choices: trailing, leading, or leading-args)
8+
function-arrows: trailing
9+
10+
# How to place commas in multi-line lists, records, etc. (choices: leading or trailing)
11+
comma-style: leading
12+
13+
# Styling of import/export lists (choices: leading, trailing, or diff-friendly)
14+
import-export-style: leading
15+
16+
# Whether to full-indent or half-indent 'where' bindings past the preceding body
17+
indent-wheres: false
18+
19+
# Whether to leave a space before an opening record brace
20+
record-brace-space: true
21+
22+
# Number of spaces between top-level declarations
23+
newlines-between-decls: 1
24+
25+
# How to print Haddock comments (choices: single-line, multi-line, or multi-line-compact)
26+
haddock-style: multi-line
27+
28+
# How to print module docstring
29+
haddock-style-module: null
30+
31+
# Styling of let blocks (choices: auto, inline, newline, or mixed)
32+
let-style: auto
33+
34+
# How to align the 'in' keyword with respect to the 'let' keyword (choices: left-align, right-align, or no-space)
35+
in-style: right-align
36+
37+
# Whether to put parentheses around a single constraint (choices: auto, always, or never)
38+
single-constraint-parens: always
39+
40+
# Output Unicode syntax (choices: detect, always, or never)
41+
unicode: never
42+
43+
# Give the programmer more choice on where to insert blank lines
44+
respectful: true
45+
46+
# Fixity information for operators
47+
fixities: []
48+
49+
# Module reexports Fourmolu should know about
50+
reexports: []
51+

0 commit comments

Comments
 (0)