Bowrna commented on a change in pull request #20848:
URL: https://github.com/apache/airflow/pull/20848#discussion_r791568755



##########
File path: dev/breeze/src/airflow_breeze/breeze.py
##########
@@ -276,6 +281,22 @@ def change_config(python, backend, cheatsheet, asciiart):
         console.print(f'[blue]Backend cached_value {backend}')
 
 
+@option_verbose
[email protected](name="static-check")
[email protected]('-t', '--type', type=click.Choice(PRE_COMMIT_LIST), 
multiple=True)
+def static_check(verbose: bool, type: Tuple[str]):
+    if check_package_installed('pre_commit'):
+        command_to_execute = ['pre-commit', 'run']
+        for single_check in type:
+            command_to_execute.append(single_check)
+        command_to_execute.append(EXTRA_STATIC_CHECK_OPTIONS)
+        output = run_command(

Review comment:
       @potiuk i tried the below code:
   ```
   @option_verbose
   @main.command(
       name="static-check",
       context_settings=dict(
           ignore_unknown_options=True,
           allow_extra_args=True,
       ),
   )
   @click.option('--all-files', is_flag=True)
   @click.option('--show-diff-on-failure', is_flag=True)
   @click.option('--last-commit', is_flag=True)
   @click.option('-t', '--type', type=click.Choice(PRE_COMMIT_LIST), 
multiple=True)
   @click.option('--files')
   @click.argument('precommit_args', nargs=-1, type=click.UNPROCESSED)
   def static_check(
       verbose: bool,
       all_files: bool,
       show_diff_on_failure: bool,
       last_commit: bool,
       type: Tuple[str],
       files,
       precommit_args,
   ):
       print('Files:', files)
       print(precommit_args)
   ```
   If I try to pass command like `Breeze2 static-check --files tests/*`,  only 
one of the file is passed into click option for files while all other files are 
passed as unknown argument in the tuple precommit_args. Could you share your 
views on this?
   
   this is the print output i got in stdout:
   ```
   (airflow-env) sathishkannan@Sathishs-MacBook-Air airflow % Breeze2 
static-check --files tests/* --head
   Files: tests/__init__.py
   precommit_args: ('tests/always', 'tests/api', 'tests/api_connexion', 
'tests/bats', 'tests/build_provider_packages_dependencies.py', 'tests/cli', 
'tests/cluster_policies', 'tests/config_templates', 'tests/conftest.py', 
'tests/core', 'tests/dag_processing', 'tests/dags', 'tests/dags_corrupted', 
'tests/dags_with_system_exit', 'tests/decorators', 
'tests/deprecated_classes.py', 'tests/executors', 'tests/hooks', 'tests/jobs', 
'tests/kubernetes', 'tests/lineage', 'tests/listeners', 'tests/macros', 
'tests/models', 'tests/operators', 'tests/plugins', 'tests/providers', 
'tests/secrets', 'tests/security', 'tests/sensors', 'tests/serialization', 
'tests/task', 'tests/test_utils', 'tests/testconfig', 'tests/ti_deps', 
'tests/timetables', 'tests/triggers', 'tests/utils', 'tests/www', '--head')
   ```
   




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to