You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, ament_mypy passes all files explicitly to mypy. There are a few issues with this approach.
First of all, there was #516 until recently (it is still present in jazzy etc.). The logic from #516 is already present in mypy if we pass it a directory, but ament_mypy passes all files individually, because some might be in a folder that is flagged with AMENT_IGNORE and need to be removed. Adding all files individually also disables the exclude feature in the mypy.ini. This is especially relevant since the ament_mypy exclude feature does not really work. Contrary to its help page, only whole directories can be excluded.
My suggestion would be to just pass the given path(s) to mypy without extracting any filenames. The AMENT_IGNORE can be handled by appending these directories to the native exclude parameter of mypy. Similarly, I would just pass the exclude parameter of ament_mypy through to mypy.
This would enable the usage of excludes in the .ini, excludes of files, the removal of the stub priority logic and filename discovery. In the end it is very confusing if e.g. the exclude doesn't work like it's described in the mypy docs.
The text was updated successfully, but these errors were encountered:
Currently, ament_mypy passes all files explicitly to mypy. There are a few issues with this approach.
First of all, there was #516 until recently (it is still present in jazzy etc.). The logic from #516 is already present in mypy if we pass it a directory, but ament_mypy passes all files individually, because some might be in a folder that is flagged with AMENT_IGNORE and need to be removed. Adding all files individually also disables the exclude feature in the mypy.ini. This is especially relevant since the ament_mypy exclude feature does not really work. Contrary to its help page, only whole directories can be excluded.
My suggestion would be to just pass the given path(s) to mypy without extracting any filenames. The AMENT_IGNORE can be handled by appending these directories to the native exclude parameter of mypy. Similarly, I would just pass the exclude parameter of ament_mypy through to mypy.
This would enable the usage of excludes in the .ini, excludes of files, the removal of the stub priority logic and filename discovery. In the end it is very confusing if e.g. the exclude doesn't work like it's described in the mypy docs.
The text was updated successfully, but these errors were encountered: