@@ -12,6 +12,7 @@ def initialize(argv)
1212 output = nil
1313 rbs_collection_path = nil
1414 initialize_config_file = false
15+ exclude_patterns = [ ]
1516
1617 opt . separator ""
1718 opt . separator "Options:"
@@ -25,6 +26,7 @@ def initialize(argv)
2526 opt . on ( "--version" , "Display typeprof version" ) { cli_options [ :display_version ] = true }
2627 opt . on ( "--collection PATH" , "File path of collection configuration" ) { |v | rbs_collection_path = v }
2728 opt . on ( "--no-collection" , "Ignore collection configuration" ) { rbs_collection_path = :no }
29+ opt . on ( "--exclude PATTERN" , "Exclude files matching glob PATTERN (can be specified multiple times)" ) { |v | exclude_patterns << v }
2830 opt . on ( "--lsp" , "LSP server mode" ) do |v |
2931 core_options [ :display_indicator ] = false
3032 cli_options [ :lsp ] = true
@@ -65,6 +67,7 @@ def initialize(argv)
6567 output_errors : false ,
6668 output_parameter_names : false ,
6769 output_source_locations : false ,
70+ exclude_patterns : exclude_patterns ,
6871 } . merge ( core_options )
6972
7073 @lsp_options = {
@@ -189,7 +192,8 @@ def generate_config_file
189192 {
190193 "typeprof_version": "experimental",
191194 "rbs_dir": "sig/",
192- "analysis_unit_dirs": #{ exist_dirs . inspect }
195+ "analysis_unit_dirs": #{ exist_dirs . inspect } ,
196+ // "exclude": ["**/templates/**/*.rb"],
193197 // "diagnostic_severity": "warning"
194198 }
195199 JSONC
0 commit comments