Skip to content

Comments

Start linting test files#2722

Merged
elland merged 11 commits intodevelopfrom
lint-also-tests
Sep 30, 2022
Merged

Start linting test files#2722
elland merged 11 commits intodevelopfrom
lint-also-tests

Conversation

@elland
Copy link
Contributor

@elland elland commented Sep 22, 2022

Added test files to the lint script, they'll no longer be skipped. We can now add these checks to CI and get warnings when it fails.

I've also added an option to bail out of linting if we hit any issues.

The changelog is sadly massive, let me know if it would make sense to do it step by step or if you're fine reviewing it like this.

@elland elland temporarily deployed to cachix September 22, 2022 15:26 Inactive
@elland elland temporarily deployed to cachix September 22, 2022 15:26 Inactive
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Sep 22, 2022
@elland elland temporarily deployed to cachix September 27, 2022 15:50 Inactive
@elland elland temporarily deployed to cachix September 27, 2022 15:50 Inactive
@elland elland marked this pull request as ready for review September 27, 2022 16:50
@elland elland temporarily deployed to cachix September 28, 2022 12:16 Inactive
@elland elland temporarily deployed to cachix September 28, 2022 12:17 Inactive
@elland elland temporarily deployed to cachix September 28, 2022 14:43 Inactive
@elland elland temporarily deployed to cachix September 28, 2022 14:43 Inactive
@stephen-smith
Copy link
Contributor

Are the hie.yaml changes necessary? They look to me like something that hie-boot or implicit-hie or something else could dynamically generate. And, perhaps more relevantly, something that, if we make this change, developers will have to update in future commits.

@elland
Copy link
Contributor Author

elland commented Sep 29, 2022

@stephen-smith that was updated with implicit-hie, but in any case shouldn't be part of this PR, reverting it 👍

@elland elland temporarily deployed to cachix September 29, 2022 07:11 Inactive
@elland elland temporarily deployed to cachix September 29, 2022 07:11 Inactive
@elland elland temporarily deployed to cachix September 29, 2022 07:11 Inactive
@elland elland temporarily deployed to cachix September 29, 2022 07:11 Inactive
@fisx fisx self-requested a review September 29, 2022 08:33
@fisx fisx temporarily deployed to cachix September 29, 2022 08:52 Inactive
@fisx fisx temporarily deployed to cachix September 29, 2022 08:52 Inactive
Copy link
Contributor

@fisx fisx left a comment

Choose a reason for hiding this comment

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

It would have been good to have two PRs: one with the changes to the linting machinery, and one with the mechanical output of make hlint-inplace-all. But since one is so tiny it wasn't a big deal to review it in one gulp.

@@ -335,7 +335,8 @@ assertCanFind brig from target = do
let targetHandle = fromMaybe (error "Impossible") (userHandle target)
get (apiVersion "v1" . brig . path "/users" . queryItem "handles" (toByteString' targetHandle) . zUser (userId from)) !!! do
const 200 === statusCode
const (userHandle target) === (>>= (listToMaybe >=> profileHandle)) . responseJsonMaybe
const (userHandle target) === ((listToMaybe >=> profileHandle) <=< responseJsonMaybe)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const (userHandle target) === ((listToMaybe >=> profileHandle) <=< responseJsonMaybe)
const (userHandle target) === (responseJsonMaybe >=> listToMaybe >=> profileHandle)

(not tested)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm now surprised the linter didn't suggest this itself… I'll test it in a bit.

@fisx
Copy link
Contributor

fisx commented Sep 29, 2022

let's hope this settles the topic of hlint once and for all! :)

@elland elland temporarily deployed to cachix September 29, 2022 09:16 Inactive
@elland elland temporarily deployed to cachix September 29, 2022 09:16 Inactive
@elland elland temporarily deployed to cachix September 29, 2022 09:54 Inactive
@elland elland temporarily deployed to cachix September 29, 2022 09:54 Inactive
@elland elland merged commit c428355 into develop Sep 30, 2022
@elland elland deleted the lint-also-tests branch September 30, 2022 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants