Correct way to filter files for custom plugin? #374
-
I apologize if this is obvious. I'm working to create a custom discovery and set of tools for a new file type (MATLAB specifically) and can't quite understand from the README.md how this works. My discovery plugin finds all of the *.m files under the directory in which statick runs (e.g. "./my_project") but I don't want to run all of the directories through the analysis tools. Should these be filtered:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
The discovery plugin is supposed to find all of the files of a certain type per package. In this case your package is at If you want to completely skip running analysis tools against a directory within your package then you can use exceptions. To specify exceptions you need to have your own directory for Statick configuration, such as https://github.com/sscpac/statick#exceptions Once you have exceptions listed you have to tell Statick where to find that file using the statick my_project --output-directory /tmp/x --user-paths my_project/statick_config It will pick up the https://github.com/sscpac/statick/blob/main/statick_tool/rsc/exceptions.yaml Another case is where you want to run some of your tools against all of your discovered files/directories (for example, because they are fast to run), but only some of your tools against a subset of your discovered files/directories (for example, the tools take a long time to run, or some subdirectories contain third-party code that you cannot modify). For that, you can configure exceptions that apply to a file glob (allows you to ignore a single file or an entire subdirectory) and you can specify a subset of tools that the exception should apply for. Note that the exceptions are applied after discovery but before a tool plugin runs (where possible, to save time), or they are applied after the tool runs but before a report is generated. |
Beta Was this translation helpful? Give feedback.
The discovery plugin is supposed to find all of the files of a certain type per package. In this case your package is at
./my_project
.If you want to completely skip running analysis tools against a directory within your package then you can use exceptions. To specify exceptions you need to have your own directory for Statick configuration, such as
my_project/statick_config/rsc
. Inside that directory is where you would place a file namedexceptions.yaml
. In that file you would list your exceptions as described in the README. If the README is not clear let me know and I will update it.https://github.com/sscpac/statick#exceptions
Once you have exceptions listed you have to tell Statick whe…