bhoogter / VB6TocSharp

Free converter from VB6 to C#. See README for quick-start. See Wiki for more information.
MIT No Attribution
89 stars 32 forks source link

Module name lint error #15

Closed jwdonal closed 2 years ago

jwdonal commented 2 years ago

I'm getting several of these errors that seems to have no resolution:

LINT FAILED: C:\Temp_vb6_junk\modFileIO.bas Module name [modFileIO.bas] must match file name [modFileIO.bas]. Rename module or class to match the other ?Lint("C:\Temp_vb6_junk\modFileIO.bas")

It's saying the names must match but they already do match. ......?

bhoogter commented 2 years ago

Sure. So, after fixing two legitimate lint errors in the master branch just now, I then renamed the module modVB6ToCS to modVB6ToCSx and ran the linter against itself. Notice the file is called modVB6ToCS.bas, which doesn't match the actual module name per the picture (see bottom). This yields an error message of:

Module name [modVB6ToCSx] must match file name [modVB6ToCS.bas]. Rename module or class to match the other

Mine doesn't have the .bas on the end of the module name when I just renamed the module.

So, normally, you name the module the same as the filename, minus the file extension. However, in your case, are you manually editing the project file? I don't see the IDE allowing you to use the period (.) in the module name, so I'm not sure how yours is functioning this way. Is it VB6 with Service Pack 6 installed?

Regardless, if the module name (not file name) does have the .bas, try without it. If the module name is somehow being detected as having the .bas, let me know and I can keep digging.

image

jwdonal commented 2 years ago

Yes, you are correct sir. I was editing the name directly in the source file. I removed the extension and then linter stopped complaining.

To avoid this confusion might I suggest a slight change to the error message so that it doesn't include the file extension? Because saying "Module name [modFileIO.bas] must match file name [modFileIO.bas]" is super confusing - since they already do match.