差異處
這裏顯示兩個版本的差異處。
下次修改 | 前次修改 下次修改 Both sides next revision | ||
java:sonarlint:eclipse_filter_configs:filter_folder_or_files [2020/08/01 23:59] tony 建立 |
java:sonarlint:eclipse_filter_configs:filter_folder_or_files [2020/08/02 00:20] tony |
||
---|---|---|---|
行 2: | 行 2: | ||
====== SonarLint - How to filter folder or files in Eclipse? ====== | ====== SonarLint - How to filter folder or files in Eclipse? ====== | ||
===== Problem ===== | ===== Problem ===== | ||
- | 起初在使用SonarLint掃描專案時,必定會將測試內容也一同列出來:\\ | + | 剛開始在使用SonarLint掃描專案時,必定會將測試程式碼也一同列出來:\\ |
{{:java:sonarlint:eclipse_filter_configs:sonarlint_lint_test_files.png|}}\\ | {{:java:sonarlint:eclipse_filter_configs:sonarlint_lint_test_files.png|}}\\ | ||
\\ | \\ | ||
行 15: | 行 15: | ||
\\ | \\ | ||
如果反悔要還原直接Remove即可。 | 如果反悔要還原直接Remove即可。 | ||
+ | ==== Exclude folder ==== | ||
+ | 第二個方式適用在於想忽略測試的資料夾。假設我的測試資料夾在src/test,可以在方法一Project的Properties中,使用GLOB type的File Exclusions設定:\\ | ||
+ | {{:java:sonarlint:eclipse_filter_configs:sonarlint_exclude_test_folder.png|}}\\ | ||
+ | \\ | ||
+ | 這樣設定後,再掃一次專案,就可以發現src/test的內容被濾掉了:\\ | ||
+ | {{:java:sonarlint:eclipse_filter_configs:sonarlint_lint_exclude_test_folder.png|}}\\ | ||
+ | ==== Global File Exclusions ==== | ||
+ | 假如你的專案很多,不想設定在各別專案上,那可以直接修改全域的設定。打開Window > Preference,在裡面的SonarLint > File Exclusions中,使用如方法二的設定方式即可:\\ | ||
+ | {{:java:sonarlint:eclipse_filter_configs:sonarlint_global_exclude_test_folder.png|}}\\ | ||
===== ===== | ===== ===== | ||
---- | ---- | ||
\\ | \\ | ||
~~DISQUS~~ | ~~DISQUS~~ |