potiuk commented on a change in pull request #5944: [AIRFLOW-5362] Reorder
imports
URL: https://github.com/apache/airflow/pull/5944#discussion_r321962777
##########
File path: .pre-commit-config.yaml
##########
@@ -190,8 +190,16 @@ repos:
language: system
entry: ./scripts/ci/ci_pylint_tests.sh
files: ^tests/.*\.py$
+ - id: isort
+ name: Run isort to sort imports
+ language: python
+ entry: isort -rc .
Review comment:
Remove `-rc .` please. Pre-commit by default passes changed filenames as
command arguments (default configuration is pass_filenames: true).
This has a number of advantages:
- in regular pre-commit it will only pass the names of files that
changed/were added in this commit/series of commit when pushing (this makes it
much faster for smaller commits)
- when you have big number of changes it will automatically split the
command to several commands run in parallel (equal to the number of threads you
have available on your PC) - distributing the changed files between those. If
you have 4 CPUs with 2 threads each it will split the big list of files between
8 isort commands and run them in parallel. This means that if you remove all
your changes now and run `pre-commit run --all-files` it will run 8 times
faster than `isort -rc .`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services