🤖Effect of this PR on checked open source code: 🤖 Effect onhome-assistant: The following messages are now emitted: - bad-float-notation:
'1000000.0' is bigger than 1e6, and it should be written as '1_000_000.0' or '1e6' instead https://github.com/home-assistant/core/blob/7442f7af28d28a2f6e5417f4cb45e08476be63ac/homeassistant/components/esphome/light.py#L244 - bad-float-notation:
'6356752.314245' is bigger than 1e6, and it should be written as '6.356752314245e6' or '6_356_752.314245' instead https://github.com/home-assistant/core/blob/7442f7af28d28a2f6e5417f4cb45e08476be63ac/homeassistant/util/location.py#L26
Effect onsentry: The following messages are now emitted: - bad-float-notation:
'1541455200.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (320 * 3600 * 24) + (22 * 3600)' or '1.5414552e9' or '1_541_455_200.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L53 - bad-float-notation:
'1541458800.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (320 * 3600 * 24) + (23 * 3600)' or '1.5414588e9' or '1_541_458_800.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L54 - bad-float-notation:
'1541462400.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (321 * 3600 * 24)' or '1.5414624e9' or '1_541_462_400.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L55 - bad-float-notation:
'1541466000.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (321 * 3600 * 24) + (1 * 3600)' or '1.541466e9' or '1_541_466_000.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L56 - bad-float-notation:
'1541469600.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (321 * 3600 * 24) + (2 * 3600)' or '1.5414696e9' or '1_541_469_600.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L57 - bad-float-notation:
'1541473200.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (321 * 3600 * 24) + (3 * 3600)' or '1.5414732e9' or '1_541_473_200.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L58 - bad-float-notation:
'1541476800.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (321 * 3600 * 24) + (4 * 3600)' or '1.5414768e9' or '1_541_476_800.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L59 - bad-float-notation:
'1541480400.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (321 * 3600 * 24) + (5 * 3600)' or '1.5414804e9' or '1_541_480_400.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L60 - bad-float-notation:
'1541484000.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (321 * 3600 * 24) + (6 * 3600)' or '1.541484e9' or '1_541_484_000.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L61 - bad-float-notation:
'1541487600.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (321 * 3600 * 24) + (7 * 3600)' or '1.5414876e9' or '1_541_487_600.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L62 - bad-float-notation:
'1541491200.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (321 * 3600 * 24) + (8 * 3600)' or '1.5414912e9' or '1_541_491_200.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L63 - bad-float-notation:
'1541494800.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (321 * 3600 * 24) + (9 * 3600)' or '1.5414948e9' or '1_541_494_800.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L64 - bad-float-notation:
'1541498400.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (321 * 3600 * 24) + (10 * 3600)' or '1.5414984e9' or '1_541_498_400.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L65 - bad-float-notation:
'1541502000.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (321 * 3600 * 24) + (11 * 3600)' or '1.541502e9' or '1_541_502_000.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L66 - bad-float-notation:
'1541505600.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (321 * 3600 * 24) + (12 * 3600)' or '1.5415056e9' or '1_541_505_600.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L67 - bad-float-notation:
'1541509200.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (321 * 3600 * 24) + (13 * 3600)' or '1.5415092e9' or '1_541_509_200.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L68 - bad-float-notation:
'1541512800.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (321 * 3600 * 24) + (14 * 3600)' or '1.5415128e9' or '1_541_512_800.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L69 - bad-float-notation:
'1541516400.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (321 * 3600 * 24) + (15 * 3600)' or '1.5415164e9' or '1_541_516_400.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L70 - bad-float-notation:
'1541520000.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (321 * 3600 * 24) + (16 * 3600)' or '1.54152e9' or '1_541_520_000.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L71 - bad-float-notation:
'1541523600.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (321 * 3600 * 24) + (17 * 3600)' or '1.5415236e9' or '1_541_523_600.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L72 - bad-float-notation:
'1541527200.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (321 * 3600 * 24) + (18 * 3600)' or '1.5415272e9' or '1_541_527_200.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L73 - bad-float-notation:
'1541530800.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (321 * 3600 * 24) + (19 * 3600)' or '1.5415308e9' or '1_541_530_800.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L74 - bad-float-notation:
'1541534400.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (321 * 3600 * 24) + (20 * 3600)' or '1.5415344e9' or '1_541_534_400.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L75 - bad-float-notation:
'1541538000.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 48) + (321 * 3600 * 24) + (21 * 3600)' or '1.541538e9' or '1_541_538_000.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/issue_examples.py#L76 - bad-float-notation:
'1658770772.902' is bigger than 1e6, and it should be written as '1.658770772902e9' or '1_658_770_772.902' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/replay_examples.py#L123 - bad-float-notation:
'1658770772.902' is bigger than 1e6, and it should be written as '1.658770772902e9' or '1_658_770_772.902' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/replay_examples.py#L129 - bad-float-notation:
'1658770772.902' is bigger than 1e6, and it should be written as '1.658770772902e9' or '1_658_770_772.902' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/replay_examples.py#L130 - bad-float-notation:
'1665063926.125' is bigger than 1e6, and it should be written as '1.665063926125e9' or '1_665_063_926.125' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/replay_examples.py#L145 - bad-float-notation:
'1665063926.125' is bigger than 1e6, and it should be written as '1.665063926125e9' or '1_665_063_926.125' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/replay_examples.py#L151 - bad-float-notation:
'1665063926.833' is bigger than 1e6, and it should be written as '1.665063926833e9' or '1_665_063_926.833' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/replay_examples.py#L152 - bad-float-notation:
'1658770772.902' is bigger than 1e6, and it should be written as '1.658770772902e9' or '1_658_770_772.902' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/replay_examples.py#L170 - bad-float-notation:
'1658770772.902' is bigger than 1e6, and it should be written as '1.658770772902e9' or '1_658_770_772.902' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/replay_examples.py#L176 - bad-float-notation:
'1658770772.902' is bigger than 1e6, and it should be written as '1.658770772902e9' or '1_658_770_772.902' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/apidocs/examples/replay_examples.py#L177 - bad-float-notation:
'172422171096.56' is bigger than 1e6, and it should be written as '1.7242217109656e11' or '172.42217109656e9' or '172_422_171_096.56' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/testutils/helpers/notifications.py#L289 - bad-float-notation:
'1504656000.0' is bigger than 1e6, and it should be written as '(3600 * 24 * 365 * 47) + (260 * 3600 * 24)' or '1.504656e9' or '1_504_656_000.0' instead https://github.com/getsentry/sentry/blob/0da785052b486eb791022727af5805a291d059a4/src/sentry/web/frontend/debug/mail.py#L198
This comment was generated for commitdc7592d |
Uh oh!
There was an error while loading.Please reload this page.
Type of Changes
Description
A little experiment to gather feedback with primers and reviews (still a draft).
The idea is to enforce normalized ways to write number above a threshold or close to 0 in absolute value:
Another idea could be to warn to use python's Decimal for number with more than 15 digits of precision, not sure if it should be the same checker though. We could also set/enforce a default precision for a project.