Skip to content
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

Getting rid of warnings and hlint suggestions #959

Conversation

Vlix
Copy link
Contributor

@Vlix Vlix commented Dec 17, 2023

Before submitting your PR, check that you've:

After submitting your PR:

  • Update the Changelog.md file with a link to your PR
  • Check that CI passes (or if it fails, for reasons unrelated to your change, like CI timeouts)

Wanted to get rid of warnings you get when building the packages in this repo, so I tried to do so. And refactored some small stuff.

Only real "change" is adding defaultGzipSettings to hopefully at some point be able to phase out the data-default dependency wai-extra still has.

Vlix added 6 commits December 17, 2023 20:11
* using 'copyBytes' instead of 'memcpy' as shown in the deprecation warning
* using 'fdRead' from a different module as shown in the deprecation warning
* writing some functions more point-free (i.e. eta reducing)
* removing redundant parentheses
* some import list cleanup
…n phase out the 'Default' instance at some point
…. Also defaulting content length to 0 if there are no headers, and added custom 'error' to fail with more info, even though it should never happen.
@kazu-yamamoto
Copy link
Contributor

Is this ready for merging?

@Vlix
Copy link
Contributor Author

Vlix commented Dec 18, 2023

If you feel the changes are acceptable, this is indeed ready for merging.

@kazu-yamamoto kazu-yamamoto self-requested a review December 22, 2023 00:30
Copy link
Contributor

@kazu-yamamoto kazu-yamamoto left a comment

Choose a reason for hiding this comment

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

LGTM

@kazu-yamamoto kazu-yamamoto merged commit e64e2b8 into yesodweb:master Dec 22, 2023
15 checks passed
@kazu-yamamoto
Copy link
Contributor

Merged.

Off topic but if we could agree with a formatter, it would be great.
I'm using fourmolu recently.

@Vlix Vlix deleted the getting-rid-of-warnings-and-hlint-suggestions branch December 22, 2023 01:12
@Vlix
Copy link
Contributor Author

Vlix commented Dec 22, 2023

I've also always used fourmolu. Also just added it to the http-types package I just took maintainership over. Shall I (when I have time) add the fourmolu.yaml and do a full formatting of the code base?

Do we want specific settings? I mostly go for very diff-able settings and readability. (4 spaces indent, half-indent wheres)

@kazu-yamamoto
Copy link
Contributor

@kazu-yamamoto
Copy link
Contributor

When we reach consensus, I will add fourmolu.yaml and format most HS files (without HS with CPP) and send a PR.

@Vlix
Copy link
Contributor Author

Vlix commented Dec 22, 2023

I see our settings/styles are almost identical.
Only difference is I prefer function arrows as trailing, but that is pretty inconsequential.
I've also disabled the column-limit because I had some issues in certain situations in our production code base, but can't remember why that was.

So all in all, I'd say the fourmolu.yaml from quic is fine as is and LGTM.

@kazu-yamamoto
Copy link
Contributor

Closing in favor of #965.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants