-
-
Notifications
You must be signed in to change notification settings - Fork 391
Set up partial functions ratchet #2974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mergify
merged 13 commits into
haskell:master
from
michaelpj:mpj/partial-functions-ratchet
Jun 24, 2022
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
52fcc30
HLint partial functions
michaelpj 19d54aa
Delete commented out stuff
michaelpj fd08faa
Delete flag-based warnings, unclear they add much
michaelpj 59471c8
Delete DA-specific hints
michaelpj c242e41
Delete extra cpp args
michaelpj 5774fc1
Delete extension options relating to dead build system
michaelpj 29f34bf
Don't bother trying to restrict CPP for now, it's everywhere
michaelpj 7bc240a
Make the hlint job fail if there are any errors
michaelpj ac538fa
Fix for rebase, add unsafePerformIO and fold1 variants
michaelpj bf82912
Add some more indexing functions
michaelpj b6a91b0
Try turning off hlint on this test file
michaelpj 08771a1
Add .hlint.yaml file for hls-hlint-plugin
michaelpj f70128b
Merge branch 'master' into mpj/partial-functions-ratchet
mergify[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,185 @@ | ||
# HLint configuration file | ||
# https://github.com/ndmitchell/hlint | ||
########################## | ||
|
||
# To run HLint do: | ||
# $ hlint --git -j4 | ||
|
||
# Warnings currently triggered by our code | ||
- ignore: {name: "Use <$>"} | ||
- ignore: {name: "Use :"} | ||
- ignore: {name: "Redundant do"} | ||
- ignore: {name: "Avoid lambda"} | ||
- ignore: {name: "Use newtype instead of data"} | ||
- ignore: {name: "Use unless"} | ||
- ignore: {name: "Move brackets to avoid $"} | ||
- ignore: {name: "Eta reduce"} | ||
- ignore: {name: "Parse error"} | ||
- ignore: {name: "Reduce duplication"} | ||
- ignore: {name: "Use ++"} | ||
- ignore: {name: "Use $>"} | ||
- ignore: {name: "Use section"} | ||
- ignore: {name: "Use record patterns"} | ||
- ignore: {name: "Use camelCase"} | ||
- ignore: {name: "Use uncurry"} | ||
- ignore: {name: "Avoid lambda using `infix`"} | ||
|
||
# Gives at least one suggestion we don't like. | ||
- ignore: {name: "Use <=<"} | ||
- ignore: {name: "Use zipFrom"} | ||
- ignore: {name: "Use zipWithFrom"} | ||
|
||
# We are using the "redundant" return/pure to assign a name. We do not want to | ||
# delete it. In particular, this is not an improvement: | ||
# Found: | ||
# do options <- somethingComplicated | ||
# pure options | ||
# Perhaps: | ||
# do somethingComplicated | ||
- ignore: {name: "Redundant return"} | ||
- ignore: {name: "Redundant pure"} | ||
|
||
# Off by default hints we like | ||
- warn: {name: Use module export list} | ||
|
||
# Condemn nub and friends | ||
- warn: {lhs: nub (sort x), rhs: Data.List.Extra.nubSort x} | ||
- warn: {lhs: nub, rhs: Data.List.Extra.nubOrd} | ||
- warn: {lhs: nubBy, rhs: Data.List.Extra.nubOrdBy} | ||
- warn: {lhs: Data.List.Extra.nubOn, rhs: Data.List.Extra.nubOrdOn} | ||
|
||
- functions: | ||
# Things that are unsafe in Haskell base library | ||
- name: unsafePerformIO | ||
within: | ||
- Development.IDE.Core.Shake | ||
- Development.IDE.GHC.Util | ||
- Development.IDE.Graph.Internal.Database | ||
- Development.IDE.Graph.Internal.Paths | ||
- Development.IDE.Graph.Internal.Profile | ||
- Ide.Types | ||
- Test.Hls | ||
- Test.Hls.Command | ||
- Wingman.Debug | ||
- Wingman.Types | ||
- AutoTupleSpec | ||
- name: unsafeInterleaveIO | ||
within: | ||
- Development.IDE.LSP.LanguageServer | ||
- {name: unsafeDupablePerformIO, within: []} | ||
- name: unsafeCoerce | ||
within: | ||
- Ide.Plugin.Eval.Code | ||
- Development.IDE.Core.Compile | ||
- Development.IDE.Types.Shake | ||
- Wingman.Judgements.SYB | ||
- Ide.Plugin.Properties | ||
|
||
# Things that are a bit dangerous in the GHC API | ||
- name: nameModule | ||
within: | ||
- Development.IDE.GHC.CoreFile | ||
- Ide.Plugin.CallHierarchy.Internal | ||
- Ide.Plugin.Rename | ||
- Compat.HieBin | ||
|
||
# Partial functions | ||
- name: Data.List.head | ||
michaelpj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
within: | ||
- Main | ||
- Experiments | ||
- Development.IDE.Core.Shake | ||
- Development.IDE.Plugin.CodeAction | ||
- Development.IDE.Plugin.Completions | ||
- Development.IDE.Plugin.CodeAction.ExactPrint | ||
- Development.IDE.Session | ||
- Development.IDE.Spans.Documentation | ||
- Ide.Plugin.CallHierarchy.Internal | ||
- TExpectedActual | ||
- TRigidType | ||
- TRigidType | ||
- Ide.Plugin.Class | ||
- Wingman.Tactics | ||
|
||
- name: Data.List.tail | ||
within: | ||
- Main | ||
- Development.Benchmark.Rules | ||
- Development.IDE.Plugin.CodeAction | ||
- Development.IDE.Plugin.CodeAction.ExactPrint | ||
- Development.IDE.Session | ||
- IDE.Plugin.Eval.Code | ||
- IDE.Plugin.Eval.Util | ||
- UnificationSpec | ||
|
||
- name: Data.List.last | ||
within: | ||
- GenChangelogs | ||
- Main | ||
|
||
- name: Data.List.init | ||
within: [] | ||
|
||
- name: Data.List.foldl1' | ||
within: [] | ||
|
||
- name: Data.List.foldr1' | ||
within: [] | ||
|
||
- name: "Data.List.!!" | ||
within: | ||
- Main | ||
- Experiments | ||
- FunctionalCodeAction | ||
- Development.IDE.Plugin.CodeAction | ||
- Development.IDE.Plugin.Completions.Logic | ||
- Development.IDE.Spans.Documentation | ||
- Wingman.CaseSplit | ||
- Wingman.Simplify | ||
|
||
|
||
- name: Data.Text.head | ||
within: | ||
- Development.IDE.Plugin.CodeAction | ||
- Development.IDE.Plugin.Completions.Logic | ||
|
||
- name: Data.Foldable.foldl1 | ||
within: [] | ||
|
||
- name: Data.Foldable.foldr1 | ||
within: | ||
- Wingman.Tactics | ||
|
||
- name: Data.Maybe.fromJust | ||
within: | ||
- Experiments | ||
- Main | ||
- MultipleImports | ||
- Progress | ||
- Utils | ||
- Development.IDE.Core.Compile | ||
- Development.IDE.Core.Rules | ||
- Development.IDE.Core.Shake | ||
- Development.IDE.Plugin.Completions | ||
- Development.IDE.Plugin.CodeAction.ExactPrint | ||
- Development.IDE.Test | ||
- Development.IDE.Graph.Internal.Profile | ||
- Development.IDE.Graph.Internal.Rules | ||
- Ide.Plugin.Class | ||
|
||
- name: "Data.Map.!" | ||
within: | ||
- Wingman.LanguageServer | ||
|
||
- name: "Data.IntMap.!" | ||
within: [] | ||
|
||
- name: "Data.Vector.!" | ||
within: [] | ||
|
||
- name: "GHC.Arr.!" | ||
within: [] | ||
|
||
# We really do not want novel usages of restricted functions, and mere | ||
# Warning is not enough to prevent those consistently; you need a build failure. | ||
- error: {name: Avoid restricted function} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# This is here so that the tests in this package don't | ||
# pick up the configuration from HLS's own .hlint.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
module WError where | ||
{-# ANN module "HLint: ignore" #-} | ||
main = undefined |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.