mik-laj commented on a change in pull request #9531:
URL: https://github.com/apache/airflow/pull/9531#discussion_r446609259



##########
File path: airflow/plugins_manager.py
##########
@@ -164,8 +163,28 @@ def load_plugins_from_plugin_directory():
     global plugins  # pylint: disable=global-statement
     log.debug("Loading plugins from directory: %s", settings.PLUGINS_FOLDER)
 
+    patterns_by_dir: Dict[str, List[Pattern[str]]] = {}
+
     # Crawl through the plugins folder to find AirflowPlugin derivatives
-    for root, _, files in os.walk(settings.PLUGINS_FOLDER, followlinks=True):  
# noqa # pylint: disable=too-many-nested-blocks
+    for root, dirs, files in os.walk(settings.PLUGINS_FOLDER, 
followlinks=True):  # noqa # pylint: disable=too-many-nested-blocks
+
+        patterns: List[Pattern[str]] = patterns_by_dir.get(root, [])
+        ignore_file = os.path.join(root, '.pluginignore')
+
+        if os.path.isfile(ignore_file):
+            with open(ignore_file, 'r') as file:

Review comment:
       I like this code now. :-)
   
   Moving this method to airflow.utils.file is a good idea. This will allow us 
to delete the duplicate code.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to