mirror of
https://github.com/haskell-actions/run-ormolu.git
synced 2024-12-01 18:56:02 +03:00
Initial commit
This commit is contained in:
commit
e1f3ad03e2
18
.github/workflows/ci.yaml
vendored
Normal file
18
.github/workflows/ci.yaml
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
name: CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
jobs:
|
||||
test-linux:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Hello world action step
|
||||
uses: mrkkrp/ormolu-action@master
|
||||
with:
|
||||
who-to-greet: 'Mona the Octocat'
|
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
node_modules/
|
||||
packages/*/node_modules/
|
||||
packages/*/lib/
|
||||
packages/*/__tests__/_temp/
|
||||
.DS_Store
|
||||
*.xar
|
||||
packages/*/audit.json
|
28
LICENSE.md
Normal file
28
LICENSE.md
Normal file
@ -0,0 +1,28 @@
|
||||
Copyright © 2020–present Mark Karpov
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name Mark Karpov nor the names of contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS “AS IS” AND ANY EXPRESS
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
24
README.md
Normal file
24
README.md
Normal file
@ -0,0 +1,24 @@
|
||||
# Ormolu action
|
||||
|
||||
![CI](https://github.com/mrkkrp/ormolu-action/workflows/CI/badge.svg?branch=master)
|
||||
|
||||
This is Ormolu action that helps to ensure that your Haskell project is
|
||||
formatted with [Ormolu][ormolu].
|
||||
|
||||
* A detailed description of what the action does
|
||||
|
||||
## Inputs
|
||||
|
||||
TODO
|
||||
|
||||
## Outputs
|
||||
|
||||
TODO
|
||||
|
||||
## Example usage
|
||||
|
||||
```yaml
|
||||
TODO
|
||||
```
|
||||
|
||||
[ormolu]: https://github.com/tweag/ormolu
|
10
action.yml
Normal file
10
action.yml
Normal file
@ -0,0 +1,10 @@
|
||||
name: 'Ormolu'
|
||||
description: 'Check formatting of Haskell code with Ormolu'
|
||||
inputs:
|
||||
who-to-greet:
|
||||
description: 'Who to greet'
|
||||
required: true
|
||||
default: 'World'
|
||||
runs:
|
||||
using: 'node12'
|
||||
main: 'dist/index.js'
|
24559
dist/index.js
vendored
Normal file
24559
dist/index.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/index.js.map
vendored
Normal file
1
dist/index.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1176
dist/licenses.txt
vendored
Normal file
1176
dist/licenses.txt
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3910
dist/sourcemap-register.js
vendored
Normal file
3910
dist/sourcemap-register.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
26
index.js
Normal file
26
index.js
Normal file
@ -0,0 +1,26 @@
|
||||
const core = require('@actions/core');
|
||||
const github = require('@actions/github');
|
||||
|
||||
// https://github.com/actions/toolkit
|
||||
|
||||
// 1. download ormolu executable using @actions/tool-cache perhaps
|
||||
// https://github.com/tweag/ormolu/releases/download/0.1.3.0/ormolu-Linux
|
||||
// https://github.com/tweag/ormolu/releases/download/0.1.3.0/ormolu-macOS
|
||||
// https://github.com/tweag/ormolu/releases/download/0.1.3.0/ormolu-Windows
|
||||
|
||||
// 2. grep Haskell files and run ormolu
|
||||
|
||||
// 3. call git to highlight diffs
|
||||
|
||||
try {
|
||||
// `who-to-greet` input defined in action metadata file
|
||||
const nameToGreet = core.getInput('who-to-greet');
|
||||
console.log(`Hello ${nameToGreet}!`);
|
||||
const time = (new Date()).toTimeString();
|
||||
core.setOutput("time", time);
|
||||
// Get the JSON webhook payload for the event that triggered the workflow
|
||||
const payload = JSON.stringify(github.context.payload, undefined, 2)
|
||||
console.log(`The event payload: ${payload}`);
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
1299
package-lock.json
generated
Normal file
1299
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
32
package.json
Normal file
32
package.json
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "ormolu-action",
|
||||
"version": "1.0.0",
|
||||
"description": "Check formatting of Haskell code with Ormolu.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"prepare": "ncc build index.js -o dist",
|
||||
"all": "npm run prepare"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/mrkkrp/ormolu-action.git"
|
||||
},
|
||||
"keywords": [
|
||||
"foramtter",
|
||||
"haskell"
|
||||
],
|
||||
"author": "Mark Karpov",
|
||||
"license": "BSD 3 clause",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.1.0",
|
||||
"@actions/github": "^1.1.0",
|
||||
"@vercel/ncc": "^0.24.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vercel/ncc": "^0.24.0"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/mrkkrp/ormolu-action/issues"
|
||||
},
|
||||
"homepage": "https://github.com/mrkkrp/ormolu-action#readme"
|
||||
}
|
4
test-code/Main
Normal file
4
test-code/Main
Normal file
@ -0,0 +1,4 @@
|
||||
module Main (main) where
|
||||
|
||||
main :: IO ()
|
||||
main = return ()
|
4
test-code/Main.hs
Normal file
4
test-code/Main.hs
Normal file
@ -0,0 +1,4 @@
|
||||
module Main (main) where
|
||||
|
||||
main :: IO ()
|
||||
main = return ()
|
Loading…
Reference in New Issue
Block a user