@@ -9,7 +9,6 @@ import argparse
9
9
import logging
10
10
import os
11
11
import sys
12
- import warnings
13
12
14
13
from codebasin import config , finder , report , util
15
14
from codebasin .walkers .platform_mapper import PlatformMapper
@@ -56,15 +55,6 @@ def main():
56
55
version = f"Code Base Investigator { version } " ,
57
56
help = "Display version information and exit." ,
58
57
)
59
- deprecated_args = parser .add_argument_group ("deprecated options" )
60
- deprecated_args .add_argument (
61
- "-c" ,
62
- "--config" ,
63
- dest = "config_file" ,
64
- metavar = "<config-file>" ,
65
- action = "store" ,
66
- help = "Configuration YAML file. " + "Defaults to config.yaml." ,
67
- )
68
58
parser .add_argument (
69
59
"-v" ,
70
60
"--verbose" ,
@@ -140,22 +130,6 @@ def main():
140
130
# Determine the root directory based on where codebasin is run.
141
131
rootdir = os .path .realpath (os .getcwd ())
142
132
143
- if args .config_file and args .analysis_file :
144
- raise RuntimeError (
145
- "Cannot use --config (-c) with TOML analysis files." ,
146
- )
147
-
148
- # If no file is specified, legacy behavior checks for config.yaml
149
- config_file = args .config_file
150
- if args .config_file is None and args .analysis_file is None :
151
- warnings .warn (
152
- "Implicitly defined configuration files are deprecated." ,
153
- DeprecationWarning ,
154
- )
155
- config_file = os .path .join (rootdir , "config.yaml" )
156
- if not os .path .exists (config_file ):
157
- raise RuntimeError (f"Could not find config file { config_file } " )
158
-
159
133
# Set up a default codebase and configuration object.
160
134
codebase = {
161
135
"files" : [],
@@ -166,25 +140,6 @@ def main():
166
140
}
167
141
configuration = {}
168
142
169
- # Load the configuration file if it exists, obeying any platform filter.
170
- if config_file is not None :
171
- warnings .warn (
172
- "YAML configuration files are deprecated. "
173
- + "Use TOML analysis files instead." ,
174
- DeprecationWarning ,
175
- )
176
- if not util .ensure_yaml (config_file ):
177
- logging .getLogger ("codebasin" ).error (
178
- "Configuration file does not have YAML file extension." ,
179
- )
180
- sys .exit (1 )
181
- codebase , configuration = config .load (
182
- config_file ,
183
- rootdir ,
184
- exclude_patterns = args .excludes ,
185
- filtered_platforms = args .platforms ,
186
- )
187
-
188
143
# Load the analysis file if it exists.
189
144
if args .analysis_file is not None :
190
145
path = os .path .realpath (args .analysis_file )
@@ -222,12 +177,11 @@ def main():
222
177
223
178
# Parse the source tree, and determine source line associations.
224
179
# The trees and associations are housed in state.
225
- legacy_warnings = True if config_file else False
226
180
state = finder .find (
227
181
rootdir ,
228
182
codebase ,
229
183
configuration ,
230
- legacy_warnings = legacy_warnings ,
184
+ legacy_warnings = False ,
231
185
)
232
186
233
187
# Count lines for platforms
@@ -247,16 +201,10 @@ def main():
247
201
248
202
# Print clustering report
249
203
if report_enabled ("clustering" ):
250
- # Legacy behavior: guess prefix from YAML filename
251
- if config_file is not None :
252
- output_prefix = os .path .realpath (guess_project_name (config_file ))
253
-
254
- # Modern behavior: append platforms to TOML filename
255
- else :
256
- basename = os .path .basename (args .analysis_file )
257
- filename = os .path .splitext (basename )[0 ]
258
- platform_names = [p for p in codebase ["platforms" ]]
259
- output_prefix = "-" .join ([filename ] + platform_names )
204
+ basename = os .path .basename (args .analysis_file )
205
+ filename = os .path .splitext (basename )[0 ]
206
+ platform_names = [p for p in codebase ["platforms" ]]
207
+ output_prefix = "-" .join ([filename ] + platform_names )
260
208
261
209
clustering_output_name = output_prefix + "-dendrogram.png"
262
210
clustering = report .clustering (clustering_output_name , setmap )
0 commit comments