Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gh-vending-machine-freckle[bot] authored Jan 6, 2025
0 parents commit 62a0b4a
Show file tree
Hide file tree
Showing 38 changed files with 1,515 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Stop traversing up parent directories here
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.hs]
indent_size = 2
indent_style = space
max_line_length = 80
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @freckle/backenders
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
16 changes: 16 additions & 0 deletions .github/workflows/add-asana-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Asana

on:
pull_request:
types: [opened]

jobs:
link-asana-task:
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- uses: Asana/[email protected]
id: postAttachment
with:
asana-secret: ${{ secrets.ASANA_API_ACCESS_KEY }}
- run: echo "Status is ${{ steps.postAttachment.outputs.status }}"
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI

on:
pull_request:
push:
branches: main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: generate
uses: freckle/stack-action/generate-matrix@v4
outputs:
stack-yamls: ${{ steps.generate.outputs.stack-yamls }}

test:
needs: generate
runs-on: ubuntu-latest

strategy:
matrix:
stack-yaml: ${{ fromJSON(needs.generate.outputs.stack-yamls) }}
fail-fast: false

steps:
- uses: actions/checkout@v4
- id: stack
uses: freckle/stack-action@v5
env:
STACK_YAML: ${{ matrix.stack-yaml }}

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: haskell/actions/hlint-setup@v2
- uses: haskell/actions/hlint-run@v2
with:
fail-on: warning
19 changes: 19 additions & 0 deletions .github/workflows/mergeabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Mergeabot

on:
schedule:
- cron: "0 0 * * *"

pull_request:

permissions:
contents: write
pull-requests: write

jobs:
mergeabot:
runs-on: ubuntu-latest
steps:
- uses: freckle/mergeabot-action@v2
with:
quarantine-days: 5
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release

on:
push:
branches: main

jobs:
release:
if: false # Remove when ready to release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- id: tag
uses: freckle/haskell-tag-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- if: steps.tag.outputs.tag
uses: freckle/stack-upload-action@v2
env:
HACKAGE_API_KEY: ${{ secrets.HACKAGE_UPLOAD_API_KEY }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.stack-work
*.hie
.hiedb
65 changes: 65 additions & 0 deletions .hlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
- ignore: {name: "Redundant do", within: spec}
- ignore: {name: "Eta reduce"}
- ignore: {name: "Use list comprehension"}
- ignore: {name: "Reduce duplication"}
- ignore: {name: "Use fmap"} # we use classy prelude so this would be in error
- ignore: {name: "Avoid restricted function", within: "**.Prelude"} # allow "as X"
- ignore: {name: "Use ."} # commonly broken or less readable
- ignore: {name: "Use &&"} # we like "and" at 3+ elements
- ignore: {name: "Use ||"} # we like "or" at 3+ elements
- ignore: {name: "Use join"} # this often leads to cryptic code when do notation is easier to read
- ignore: {name: "Use Just"} # makes code less readable
- ignore: {name: "Redundant ^."} # commonly broken by esqueleto

# Custom Warnings
- warn: {lhs: mapM, rhs: traverse}
- warn: {lhs: mapM_, rhs: traverse_}
- warn: {lhs: forM, rhs: for}
- warn: {lhs: forM_, rhs: for_}
- warn: {lhs: return, rhs: pure}

# Specify additional command line arguments
- arguments:
- -XBangPatterns
- -XDataKinds
- -XDeriveAnyClass
- -XDeriveFoldable
- -XDeriveFunctor
- -XDeriveGeneric
- -XDeriveLift
- -XDeriveTraversable
- -XDerivingStrategies
- -XFlexibleContexts
- -XFlexibleInstances
- -XGADTs
- -XGeneralizedNewtypeDeriving
- -XLambdaCase
- -XMultiParamTypeClasses
- -XNoImplicitPrelude
- -XNoMonomorphismRestriction
- -XOverloadedStrings
- -XQuasiQuotes
- -XRankNTypes
- -XRecordWildCards
- -XScopedTypeVariables
- -XStandaloneDeriving
- -XTypeApplications
- -XTypeFamilies

- modules:
- {name: [Data.Set], as: Set}
- {name: [Data.Map], as: Map}
- {name: [Data.HashSet], as: HashSet}
- {name: [Data.HashMap.Strict], as: HashMap}
- {name: [Data.Text], as: T}
- {name: [Data.Text.Encoding], as: T}
- {name: [Data.Text.IO], as: T}
- {name: [Data.Text.Lazy], as: TL}
- {name: [Data.Text.Lazy.Encoding], as: TL}
- {name: [Data.Text.IO.Lazy], as: TL}
- {name: [Data.ByteString], as: BS}
- {name: [Data.ByteString.Lazy], as: BSL}
- {name: [Data.ByteString.Char8], as: BS8}
- {name: [Data.ByteString.Lazy.Char8], as: BSL8}
- {name: [Data.List.NonEmpty], as: NE}
- {name: [Data.Sequence], as: Seq}
4 changes: 4 additions & 0 deletions .restyled.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
restylers:
- fourmolu
- "!stylish-haskell"
- "*"
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## [_Unreleased_](https://github.com/freckle/haskell-library-template/compare/v__...main)

## [v0.0.0.0](https://github.com/freckle/haskell-library-template/tree/v0.0.0.0)

First tagged release.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2024 Renaissance Learning Inc

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
82 changes: 82 additions & 0 deletions README.lhs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# haskell-library-template

[![Hackage](https://img.shields.io/hackage/v/haskell-library-template.svg?style=flat)](https://hackage.haskell.org/package/haskell-library-template)
[![Stackage Nightly](http://stackage.org/package/haskell-library-template/badge/nightly)](http://stackage.org/nightly/package/haskell-library-template)
[![Stackage LTS](http://stackage.org/package/haskell-library-template/badge/lts)](http://stackage.org/lts/package/haskell-library-template)
[![CI](https://github.com/freckle/haskell-library-template/actions/workflows/ci.yml/badge.svg)](https://github.com/freckle/haskell-library-template/actions/workflows/ci.yml)

_Synopsis_

## Example

<!--
```haskell
module Main (main) where
import Prelude
import Text.Markdown.Unlit ()
```
-->
```haskell
someExample :: IO ()
someExample = putStrLn "Hello world"
```
<!--
```haskell
main :: IO ()
main = someExample
```
-->
## Development & Tests
```console
stack build --fast --pedantic --test --file-watch
```
---
## How to use this Template
Haskell library template used at Freckle.
### Create your repo
```sh
gh repo create --template freckle/haskell-library-template --public freckle/<name>
git clone [email protected]:freckle/<name>
cd ./<name>
```
### Rename your package
```sh
find -type f -exec \
sed -i s/haskell-library-template/my-name/ {} +
```
Edit `package.yaml` as necessary.
### Enable release
When you are ready to release your library, simply remove the conditional from
the release workflow.
```diff
- - if: false # Remove when ready to release
```
### Open repo up to [hacktoberfest][hacktoberfest] contributions
Add the `hacktoberfest` topic to your repo if
- you're planning on releasing it as open source, and
- you think it would benefit from and be amenable to public contributions
[hacktoberfest]: https://hacktoberfest.digitalocean.com/
---
[CHANGELOG](./CHANGELOG.md) | [LICENSE](./LICENSE)
1 change: 1 addition & 0 deletions README.md
Loading

0 comments on commit 62a0b4a

Please sign in to comment.