-
Notifications
You must be signed in to change notification settings - Fork 16.4k
[AIRFLOW-XXXX] Add pre-commit check for utf-8 file encoding #7347
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
[AIRFLOW-XXXX] Add pre-commit check for utf-8 file encoding #7347
Conversation
|
Related to #7338 |
|
I want to do it using pyupgrade: #7343 I don't know if we want to duplicate tools that do the same. |
|
I think we can add it for now and replace with pyupgrade when it's ready. Pyupgrade has more things that it fixes but I see no problem with adding it now especially that it is built-in in one of the repos we have now. |
|
However we should exclude vendor files from this for sure |
potiuk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned - for now it's a good solution especially that encodings were added in few files in the meantime. But _vendor should be excluded - similarly as for the other checks.
|
I don't know if adding magic comments with coding is a problem that is worth solving. It seems to me that if someone adds this comment it does not cause serious problems and we do not need a temporary solution. Instead of developing a temporary solution for a maximum of 2 weeks, you can make other contributions. I am not against this change. If you decide to finish it, I will gladly accept it. I just wanted to show the wider context of my change. Deleting the magic of comments is only an intermediate step, but it is not my goal. |
|
I think discussing it now took more time than implementing it :). I am all for intermediate solutions if they are super-simple to implement. |
eb79ef1 to
f9a0010
Compare
|
I think you need to apply the precommit in the next push @feluelle ! |
|
True. 🤦♂ |
Note: From Python 3.x onwards the explicit utf-8 header is no longer required. It is utf-8 encoded by default.
f9a0010 to
d50b5bb
Compare
|
That should do it! ..now I think we should get this thing quickly merged as soon as it passes to avoid further rebases :P |
Codecov Report
@@ Coverage Diff @@
## master #7347 +/- ##
==========================================
- Coverage 86.35% 86.06% -0.29%
==========================================
Files 871 871
Lines 40627 40627
==========================================
- Hits 35083 34967 -116
- Misses 5544 5660 +116
Continue to review full report at Codecov.
|
|
Thanks @feluelle ! |
Note: From Python 3.x onwards the explicit utf-8 header is no longer required. It is utf-8 encoded by default.
Issue link:
Document only change, no JIRA issueMake sure to mark the boxes below before creating PR: [x]
[AIRFLOW-NNNN]. AIRFLOW-NNNN = JIRA ID** For document-only changes commit message can start with
[AIRFLOW-XXXX].In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.