1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-02 10:47:32 +03:00
juvix/.hlint.yaml
Jonathan Cubides 807b3b1770
Update CI to install Smoke, Github actions, and Makefile fixes (#1735)
This PR adds some maintenance at different levels to the CI config, the
Make file, and formatting.

- Most of the actions used by the CI related to haskell, ormolu, hlint
and pre-commit have been updated because Github requires NodeJS 16. This
change removes all the old warnings related to nodeJs.
In the case of ormolu, the new version makes us format some files that
were not formatted before, similarly with hlint.
- The CI has been updated to use the latest version of the Smoke testing
framework, which introduced installation of the dependencies for Linux
(libicu66) and macOS (icu4c) in the CI. In the case of macOS, the CI
uses a binary for smoke. For Linux, we use stack to build smoke from the
source. The source here is in a fork of [the official Smoke
repo](https://github.com/SamirTalwar/smoke). Such includes some
features/changes that are not yet in the official repo.

- The Makefile runs the ormolu and hlint targets using as a path for the
binaries the environment variables ORMOLU and HLINT. Thus, export those
variables in your environment before running `make check,` `make format`
or `make hlint`. Otherwise, the Makefile will use the binaries provided
by `stack`.

Co-authored-by: Paul Cadman <git@paulcadman.dev>
2023-01-24 11:50:23 +01:00

85 lines
2.7 KiB
YAML

# Based on HLint configuration file from https://github.com/ndmitchell/hlint
- arguments: [--color]
# --------------------------------------------------------------------------------
# RESTRICTIONS
# --------------------------------------------------------------------------------
- extensions:
- default: false
- name:
- ApplicativeDo
- DataKinds
- DerivingStrategies
- GADTs
- ImportQualifiedPost
- LambdaCase
- NoImplicitPrelude
- OverloadedStrings
- QuasiQuotes
- RecordWildCards
- StandaloneKindSignatures
- TemplateHaskell
- TypeFamilyDependencies
- UndecidableInstances
- UnicodeSyntax
- GeneralizedNewtypeDeriving
- flags:
- default: false
- name:
- -Wall
- -Wcompat
- -Wderiving-defaults
- -Widentities
- -Wincomplete-patterns
- -Wincomplete-record-updates
- -Wincomplete-uni-patterns
- -Wmissing-deriving-strategies
- -Wredundant-constraints
- -O2 -flate-specialise -fspecialise-aggressively
- modules:
# if you import Data.Set qualified, it must be as 'Set'
- {name: [Data.Set, Data.HashSet], as: Set}
- {name: [Data.Map, Data.HashMap.Strict, Data.HashMap.Lazy], as: Map}
# - {name: Control.Arrow, within: []} # Certain modules are banned entirely
- functions:
- {name: Data.List.NonEmpty.nub, within: []}
- {name: Data.List.NonEmpty.nubBy, within: []}
# --------------------------------------------------------------------------------
# OTHER HINTS
# --------------------------------------------------------------------------------
# - warn: {name: Use explicit module export list}
# --------------------------------------------------------------------------------
# HINTS
# --------------------------------------------------------------------------------
- error: {lhs: idea Warning, rhs: warn}
- error: {lhs: idea Suggestion, rhs: suggest}
- error: {lhs: ideaN Warning, rhs: warnN}
- error: {lhs: ideaN Suggestion, rhs: suggestN}
- error: {lhs: occNameString (occName (unLoc x)), rhs: rdrNameStr x}
- error: {lhs: occNameString (occName x), rhs: occNameStr x}
- error: {lhs: noLoc (HsVar noExtField (noLoc (mkRdrUnqual (mkVarOcc x)))), rhs: strToVar x}
# --------------------------------------------------------------------------------
# IGNORES
# --------------------------------------------------------------------------------
- ignore: {name: Use let, within: [Test.All]}
- ignore: {name: Use String}
- ignore: {name: Avoid restricted qualification}
- ignore: {name: Redundant multi-way if}
- ignore: {name: Redundant bracket}
- ignore: {name: Eta reduce}
- ignore: {name: Avoid restricted alias}
- ignore: {name: Use tuple-section}
- ignore: {name: Use map with tuple-section}