Skip to content

Update pre-commit-hooks repo version#9195

Merged
kaxil merged 1 commit intoapache:masterfrom
feluelle:update-pre-commit
Jun 14, 2020
Merged

Update pre-commit-hooks repo version#9195
kaxil merged 1 commit intoapache:masterfrom
feluelle:update-pre-commit

Conversation

@feluelle
Copy link
Member

@feluelle feluelle commented Jun 9, 2020

  • use official isort pre-commit-hook
  • use official yamllint pre-commit-hook
  • run isort pre-commit-hook on all python files instead of files ending with py

Make sure to mark the boxes below before creating PR: [x]

  • Description above provides context of the change
  • Unit tests coverage for changes (not needed for documentation changes)
  • Target Github ISSUE in description if exists
  • Commits follow "How to write a good git commit message"
  • Relevant documentation is updated including usage instructions.
  • I will engage committers as explained in Contribution Workflow Example.

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

pre-commit/pre-commit-hooks now requires python3.6.1+

That is the only noticeable difference for us.

Ref: https://github.com/pre-commit/pre-commit-hooks/releases

Copy link
Member Author

Choose a reason for hiding this comment

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

Fix version - I set it to the latest version.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fix version - I set it to the latest version.

@feluelle feluelle requested review from kaxil and potiuk June 9, 2020 15:17
@potiuk
Copy link
Member

potiuk commented Jun 9, 2020

It looks like the new stylelint requires some style improvements as well @feluelle

@ashb
Copy link
Member

ashb commented Jun 9, 2020

isort seems to be wreaking havok with the UPDATING.md -- we might have to not pick the latest version (or else turn it tune it down):

diff --git a/docs/howto/operator/gcp/gcs_to_gcs.rst b/docs/howto/operator/gcp/gcs_to_gcs.rst
index e17bedf..bb3fda1 100644
--- a/docs/howto/operator/gcp/gcs_to_gcs.rst
+++ b/docs/howto/operator/gcp/gcs_to_gcs.rst
@@ -40,11 +40,9 @@ perform this task faster and more economically. The economic effects are especia
 Airflow is not hosted in Google Cloud Platform, because these operators reduce egress traffic.
 
 These operators modify source objects if the option that specifies whether objects should be deleted
-from the source after they are transferred to the sink is enabled.
 
 When you use the Google Cloud Data Transfer service, you can specify whether overwriting objects that already exist in
 the sink is allowed, whether objects that exist only in the sink should be deleted, or whether objects should be deleted
-from the source after they are transferred to the sink.
 
 Source objects can be specified using include and exclusion prefixes, as well as based on the file
 modification date.

It seems to think any line starting with from is an import line! We need to only have it operate on .py files

@feluelle
Copy link
Member Author

Thanks all - will fix the issues.

@feluelle feluelle changed the title Update pre-commit-hooks repo version [WIP] Update pre-commit-hooks repo version Jun 10, 2020
@feluelle
Copy link
Member Author

feluelle commented Jun 11, 2020

It seems to think any line starting with from is an import line! We need to only have it operate on .py files

4.3.21 fixed it.
4.3.21-2 broke it.
develop has the correct version, but it is not released yet. So I added it here and use 4.3.21-2 so we have the latest version of isort.

- use official isort pre-commit-hook
- use official yamllint pre-commit-hook
- run isort pre-commit-hook on all python files instead of files ending with py
@feluelle feluelle force-pushed the update-pre-commit branch from 12db120 to 8718ecd Compare June 11, 2020 08:00
@feluelle feluelle changed the title [WIP] Update pre-commit-hooks repo version Update pre-commit-hooks repo version Jun 11, 2020
@feluelle feluelle requested a review from ashb June 12, 2020 08:31
@kaxil kaxil merged commit 1698db4 into apache:master Jun 14, 2020
@potiuk potiuk added this to the Airflow 1.10.11 milestone Jun 20, 2020
potiuk pushed a commit that referenced this pull request Jun 20, 2020
- use official yamllint pre-commit-hook
- run isort pre-commit-hook on all python files instead of files ending with py

(cherry picked from commit 1698db4)
potiuk pushed a commit that referenced this pull request Jun 29, 2020
- use official yamllint pre-commit-hook
- run isort pre-commit-hook on all python files instead of files ending with py

(cherry picked from commit 1698db4)
kaxil pushed a commit that referenced this pull request Jul 1, 2020
- use official yamllint pre-commit-hook
- run isort pre-commit-hook on all python files instead of files ending with py

(cherry picked from commit 1698db4)
@feluelle feluelle deleted the update-pre-commit branch July 29, 2020 09:03
cfei18 pushed a commit to cfei18/incubator-airflow that referenced this pull request Mar 5, 2021
- use official yamllint pre-commit-hook
- run isort pre-commit-hook on all python files instead of files ending with py

(cherry picked from commit 1698db4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants