Skip to content

Commit

Permalink
Add Hackage and Haddock badges in the READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
fizruk committed Feb 2, 2024
1 parent 2d738df commit 05d01ab
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 18 deletions.
43 changes: 25 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Normalizer for 𝜑-calculus

[![`rzk` on Hackage](https://img.shields.io/hackage/v/eo-phi-normalizer)](http://hackage.haskell.org/package/eo-phi-normalizer)
[![Haddock](<https://shields.io/badge/Haddock%20(master)-Code%20documentation-informational>)](https://www.objectionary.com/normalizer/haddock/)

Command line normalizer of 𝜑-calculus expressions (as produced by the [EO compiler](https://github.com/objectionary/eo)).

## About
Expand Down Expand Up @@ -220,20 +223,21 @@ chmod +x scripts/run-fourmolu.sh
1. Install [Python 3](https://www.python.org/downloads/) (e.g., Python 3.10).
1. [Install pre-commit](https://pre-commit.com/#1-install-pre-commit).
- Alternatively, run `pip3 install`.
- Alternatively, run `pip3 install`.
1. [Install the git hook scripts](https://pre-commit.com/#3-install-the-git-hook-scripts).
1. Install [fourmolu](https://github.com/fourmolu/fourmolu).
```console
stack install fourmolu
```
```console
stack install fourmolu
```
- You can remove `fourmolu` later (see [SO post](https://stackoverflow.com/a/38639959))
- You can remove `fourmolu` later (see [SO post](https://stackoverflow.com/a/38639959))
1. Make a script executable.
```console
chmod +x scripts/run-fourmolu.sh
```
```console
chmod +x scripts/run-fourmolu.sh
```
#### pre-commit configs
Expand All @@ -250,24 +254,26 @@ pre-commit run -c .pre-commit-config.yaml fourmolu-format --all
#### pre-commit workflow
- `pre-commit` runs before a commit (at the [pre-commit phase](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks#_committing_workflow_hooks))
> The pre-commit hook is run first, before you even type in a commit message. It's used to inspect the snapshot that's about to be committed, to see if you've forgotten something, to make sure tests run, or to examine whatever you need to inspect in the code. Exiting non-zero from this hook aborts the commit ...
- `pre-commit` stashes ([link](https://git-scm.com/docs/git-stash)) unstaged ([link](https://git-scm.com/book/en/v2/Getting-Started-What-is-Git%3F#_the_three_states)) files.
```console
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to /home/eyjafjallajokull/.cache/pre-commit/patch1705090051-437857.
```
```console
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to /home/eyjafjallajokull/.cache/pre-commit/patch1705090051-437857.
```
- `pre-commit` runs hooks.
- A hook may exit with an error, e.g.:
```md
Format Haskell (.hs) files...............................................Failed
- hook id: fourmolu
- exit code: 102
- files were modified by this hook
```
```md
Format Haskell (.hs) files...............................................Failed
- hook id: fourmolu
- exit code: 102
- files were modified by this hook
```
- In case of the [fourmolu](https://github.com/fourmolu/fourmolu) formatter,
it's assumed that formatting a formatted `Haskell` file doesn't modify it.
Expand All @@ -277,6 +283,7 @@ pre-commit run -c .pre-commit-config.yaml fourmolu-format --all
- `pre-commit` unstashes files.
- You should stage all changes so that `pre-commit` does not complain.
- In case of `fourmolu`, stage the formatted code regions.
- Now, you can commit.
7 changes: 7 additions & 0 deletions eo-phi-normalizer/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
# eo-phi-normalizer

[![`rzk` on Hackage](https://img.shields.io/hackage/v/eo-phi-normalizer)](http://hackage.haskell.org/package/eo-phi-normalizer)
[![Haddock](<https://shields.io/badge/Haddock%20(master)-Code%20documentation-informational>)](https://www.objectionary.com/normalizer/haddock/)

Command line normalizer of 𝜑-calculus expressions (as produced by the [EO compiler](https://github.com/objectionary/eo)).

See <https://github.com/objectionary/normalizer#readme>.

1 comment on commit 05d01ab

@0pdd
Copy link

@0pdd 0pdd commented on 05d01ab Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't able to retrieve PDD puzzles from the code base and submit them to github. If you think that it's a bug on our side, please submit it to yegor256/0pdd:

set -x && set -e && set -o pipefail && cd /tmp/0pdd20240202-14-ax27o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L25vcm1hbGl6ZXIuZ2l0 && pdd -v -f /tmp/20240202-2006769-e5y2zs [1]: + set -e + set -o pipefail + cd /tmp/0pdd20240202-14-ax27o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L25vcm1hbGl6ZXIuZ2l0 + pdd...

Please, copy and paste this stack trace to GitHub:

UserError
set -x && set -e && set -o pipefail && cd /tmp/0pdd20240202-14-ax27o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L25vcm1hbGl6ZXIuZ2l0 && pdd -v -f /tmp/20240202-2006769-e5y2zs [1]:
+ set -e
+ set -o pipefail
+ cd /tmp/0pdd20240202-14-ax27o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L25vcm1hbGl6ZXIuZ2l0
+ pdd -v -f /tmp/20240202-2006769-e5y2zs

My version is 0.23.2
Ruby version is 3.1.4 at x86_64-linux
Reading from root dir /tmp/0pdd20240202-14-ax27o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L25vcm1hbGl6ZXIuZ2l0
/tmp/0pdd20240202-14-ax27o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L25vcm1hbGl6ZXIuZ2l0/.vscode/settings.json is a binary file (260 bytes)
/tmp/0pdd20240202-14-ax27o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L25vcm1hbGl6ZXIuZ2l0/flake.lock is a binary file (1494 bytes)
/tmp/0pdd20240202-14-ax27o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L25vcm1hbGl6ZXIuZ2l0/pipeline/programs/2/before.txt is a binary file (0 bytes)
/tmp/0pdd20240202-14-ax27o5/Z2l0QGdpdGh1Yi5jb206b2JqZWN0aW9uYXJ5L25vcm1hbGl6ZXIuZ2l0/renovate.json is a binary file (114 bytes)
Reading .envrc ...
Reading .gitattributes ...
Reading .github/workflows/ghc.yml ...
ERROR: ERROR: .github/workflows/ghc.yml; PDD::Error at .github/workflows/ghc.yml:46: TODO found, but puzzle can't be parsed, most probably because TODO is not followed by a puzzle marker, as this page explains: https://github.com/cqfn/pdd#how-to-format
If you can't understand the cause of this issue or you don't know how to fix it, please submit a GitHub issue, we will try to help you: https://github.com/cqfn/pdd/issues. This tool is still in its beta version and we will appreciate your feedback. Here is where you can find more documentation: https://github.com/cqfn/pdd/blob/master/README.md.
Exit code is 1

/app/objects/git_repo.rb:73:in `rescue in block in xml'
/app/objects/git_repo.rb:70:in `block in xml'
/app/vendor/ruby-3.1.4/lib/ruby/3.1.0/tempfile.rb:317:in `open'
/app/objects/git_repo.rb:69:in `xml'
/app/objects/puzzles.rb:41:in `deploy'
/app/objects/jobs/job.rb:38:in `proceed'
/app/objects/jobs/job_starred.rb:32:in `proceed'
/app/objects/jobs/job_recorded.rb:31:in `proceed'
/app/objects/jobs/job_emailed.rb:33:in `proceed'
/app/objects/jobs/job_commiterrors.rb:33:in `proceed'
/app/objects/jobs/job_detached.rb:48:in `exclusive'
/app/objects/jobs/job_detached.rb:36:in `block in proceed'
/app/objects/jobs/job_detached.rb:36:in `fork'
/app/objects/jobs/job_detached.rb:36:in `proceed'
/app/0pdd.rb:531:in `process_request'
/app/0pdd.rb:367:in `block in <top (required)>'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1706:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1706:in `block in compile!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1019:in `block (3 levels) in route!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1037:in `route_eval'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1019:in `block (2 levels) in route!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1068:in `block in process_route'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1066:in `catch'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1066:in `process_route'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1017:in `block in route!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1014:in `each'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1014:in `route!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1138:in `block in dispatch!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1109:in `catch'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1109:in `invoke'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1133:in `dispatch!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:949:in `block in call!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1109:in `catch'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1109:in `invoke'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:949:in `call!'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:938:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/deflater.rb:44:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.6/lib/rack/protection/xss_header.rb:20:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.6/lib/rack/protection/path_traversal.rb:18:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.6/lib/rack/protection/json_csrf.rb:28:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.6/lib/rack/protection/base.rb:53:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.6/lib/rack/protection/base.rb:53:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.6/lib/rack/protection/frame_options.rb:33:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/logger.rb:17:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/common_logger.rb:38:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:261:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:254:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/head.rb:12:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/method_override.rb:24:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:219:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:2018:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1576:in `block in call'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1792:in `synchronize'
/app/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.6/lib/sinatra/base.rb:1576:in `call'
/app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.8/lib/rack/handler/webrick.rb:95:in `service'
/app/vendor/bundle/ruby/3.1.0/gems/webrick-1.8.1/lib/webrick/httpserver.rb:140:in `service'
/app/vendor/bundle/ruby/3.1.0/gems/webrick-1.8.1/lib/webrick/httpserver.rb:96:in `run'
/app/vendor/bundle/ruby/3.1.0/gems/webrick-1.8.1/lib/webrick/server.rb:310:in `block in start_thread'

Please sign in to comment.