Skip to content

Commit 65b7483

Browse files
Migrate to GitHub Actions (#17)
1 parent 7fb7e29 commit 65b7483

File tree

8 files changed

+78
-77
lines changed

8 files changed

+78
-77
lines changed

.eslintrc.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"parserOptions": {
3+
"ecmaVersion": 5
4+
},
5+
"extends": "eslint:recommended",
6+
"env": {
7+
"commonjs": true
8+
},
9+
"rules": {
10+
"strict": [2, "global"],
11+
"block-scoped-var": 2,
12+
"consistent-return": 2,
13+
"eqeqeq": [2, "smart"],
14+
"guard-for-in": 2,
15+
"no-caller": 2,
16+
"no-extend-native": 2,
17+
"no-loop-func": 2,
18+
"no-new": 2,
19+
"no-param-reassign": 2,
20+
"no-return-assign": 2,
21+
"no-unused-expressions": 2,
22+
"no-use-before-define": 2,
23+
"radix": [2, "always"],
24+
"indent": [2, 2],
25+
"quotes": [2, "double"],
26+
"semi": [2, "always"]
27+
}
28+
}

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- uses: purescript-contrib/setup-purescript@main
16+
with:
17+
purescript: "0.14.0-rc3"
18+
19+
- uses: actions/setup-node@v1
20+
with:
21+
node-version: "12"
22+
23+
- name: Install dependencies
24+
run: |
25+
npm install -g bower
26+
npm install
27+
bower install --production
28+
29+
- name: Build source
30+
run: npm run-script build
31+
32+
- name: Run tests
33+
run: |
34+
bower install
35+
npm run-script test --if-present

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
/.*
22
!/.gitignore
3-
!/.jscsrc
4-
!/.jshintrc
5-
!/.travis.yml
3+
!/.eslintrc.json
4+
!/.github/
65
/bower_components/
76
/node_modules/
87
/output/

.jscsrc

Lines changed: 0 additions & 17 deletions
This file was deleted.

.jshintrc

Lines changed: 0 additions & 20 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
# purescript-partial
22

3-
[![Latest release](http://img.shields.io/bower/v/purescript-partial.svg)](https://github.com/purescript/purescript-partial/releases)
4-
[![Build Status](https://travis-ci.org/purescript/purescript-partial.svg?branch=master)](https://travis-ci.org/purescript/purescript-partial)
3+
[![Latest release](http://img.shields.io/github/release/purescript/purescript-partial.svg)](https://github.com/purescript/purescript-partial/releases)
4+
[![Build status](https://github.com/purescript/purescript-partial/workflows/CI/badge.svg?branch=master)](https://github.com/purescript/purescript-partial/actions?query=workflow%3ACI+branch%3Amaster)
5+
[![Pursuit](https://pursuit.purescript.org/packages/purescript-partial/badge)](https://pursuit.purescript.org/packages/purescript-partial)
56

67
Utilities for working with partial functions.
78

89
## Installation
910

1011
```
11-
bower install purescript-partial
12+
spago install partial
1213
```
1314

1415
## Why have a Partial type class?
1516

16-
Every now and then, you will want to use *partial functions;* that is,
17+
Every now and then, you will want to use _partial functions;_ that is,
1718
functions which don't handle every possible case of their inputs. For example,
1819
there is a function `fromJust :: ∀ a. Partial ⇒ Maybe a → a` in `Data.Maybe`,
1920
which gives you the value inside a `Just` value, or throws an error if given
2021
`Nothing`.
2122

2223
It's important that types tell the truth wherever possible, because this is a
2324
large part of what allows us to understand PureScript code easily and refactor
24-
it fearlessly. However, in certain contexts, you know that e.g. an `Either`
25+
it fearlessly. However, in certain contexts, you know that e.g. an `Either`
2526
value is always going to be `Right`, but you can't prove that to the type
2627
checker, and so you want an escape hatch so that you can write a function that
2728
doesn't have to deal with the `Left` case. This is often the case when
@@ -69,7 +70,7 @@ at src/Main.purs line 8, column 1 - line 8, column 56
6970
Prim.Partial
7071
```
7172

72-
*Aside: Yes, this is not a fantastic error. It's going to get better soon.*
73+
_Aside: Yes, this is not a fantastic error. It's going to get better soon._
7374

7475
The solution is usually to add an application of `unsafePartial` somewhere,
7576
like this:
@@ -172,7 +173,7 @@ Both implementations will behave in the same way.
172173
In this case, we know our `dot` implementation is fine, and so users of it
173174
should not have to worry about its partiality, so it makes sense to avoid
174175
propagating the constraint. Now, we will see another case where a `Partial`
175-
constraint *should* be propagated.
176+
constraint _should_ be propagated.
176177

177178
Let us suppose we want a `foldr1` function, which works in a very similar way
178179
to `foldr` on Lists, except that it doesn't require an initial value to be
@@ -221,4 +222,4 @@ the type system do hold.
221222

222223
## API Documentation
223224

224-
* API documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-partial).
225+
- API documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-partial).

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
"private": true,
33
"scripts": {
44
"clean": "rimraf output && rimraf .pulp-cache",
5-
"build": "jshint src && jscs src && pulp build -- --censor-lib --strict",
5+
"build": "eslint src && pulp build -- --censor-lib --strict",
66
"test": "pulp test"
77
},
88
"devDependencies": {
9-
"jscs": "^3.0.7",
10-
"jshint": "^2.9.5",
9+
"eslint": "^7.15.0",
1110
"pulp": "^15.0.0",
12-
"purescript-psa": "^0.6.0",
13-
"rimraf": "^2.6.2"
11+
"purescript-psa": "^0.8.0",
12+
"rimraf": "^3.0.2"
1413
}
1514
}

0 commit comments

Comments
 (0)