-
Notifications
You must be signed in to change notification settings - Fork 26
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
Brushups for OTP27 #77
Brushups for OTP27 #77
Conversation
Oops.... To resolve this situation, we might have to drop OTP22 in order to support OTP27 in the future. |
I'm converting this to a draft because there doesn't seem to be an easy way to make both OTP22 and OTP27 work fine. |
Feel free to drop OTP 22 👍 |
363e74b
to
04670ba
Compare
Dropped support for OTP 22. (Also squashed some unnecessary trial and error commits.) |
Hmm ok ofcourse 🤦 iso8601 PR (erlsci/iso8601#62) wasn't merged yet. I'll leave this PR open for about a week and will try and chase the maintainer of iso8601 on Erlanger Slack/Forum if not merged by then so we can open up OTP27 👍 |
Perhaps it is worth considering inlining the iso8601 parsing here? ISO8601 can be trivial to parse. Here is a minimal implementation: -module(foo).
-export([parse/1]).
-define(is_digit(D), D1 >= $0, D1 =< $9).
parse([Y1, Y2, Y3, Y4, $-, O1, O2, $-, D1, D2, $T, H1, H2, $:, M1, M2, $:, S1, S2 | Rest])
when Rest =:= ""; Rest =:= "Z" ->
{d4(Y1, Y2, Y3, Y4), d2(O1, O2), d2(D1, D2), d2(H1, H2), d2(M1, M2), d2(S1, S2)}.
d4(D1, D2, D3, D4) when ?is_digit(D1), ?is_digit(D2), ?is_digit(D3), ?is_digit(D4) ->
(D1 - $0) * 1000 + (D2 - $0) * 100 + (D3 - $0) * 10 + (D4 - $0).
d2(D1, D2) when ?is_digit(D1), ?is_digit(D2) ->
(D1 - $0) * 10 + (D2 - $0). It doesn't support offsets, only no offset or Z, but that's probably an ok assumption make?
|
Unfortunately, ISO8601 is not so trivial. There are both the basic format like
I think assuming all Expirations do not have time offsets is risky. Although AWS services seem to use Therefore, I think it is better to depend on an ISO8601 library for now rather than parse it ourselves. |
28ce197
to
d7433ba
Compare
Force pushed with a Thank you @dw-kihara ❤️ |
hex: 0.3.1 and github: 0.3.1 both releases available 👌 |
When trying OTP27, I encountered several problems:
iso8601
cannot be compiled.rebar3_lint
cannot be compiled.aws_credentials_httpc:start/1
is detected.To resolve these issues:
rebar3_lint
, I updatedrebar3_lint
and addressed the new linter warnings.aws_credentials_httpc:start/1
, I adjusted the code without changing its behavior.Closes #78