ClimberMel / SMF_Add-in

Stock Market Functions for Excel using VBA
https://climbermel.github.io/SMF_Add-in/
15 stars 5 forks source link

Automatic Language Detection #86

Open DecimalTurn opened 4 months ago

DecimalTurn commented 4 months ago

Currently, this repo is marked as a Visual Basic 6.0 (VB6) repo since more than 50% of the code is indentified as VB6.

image

The reason for it is that a lot of code modules in this project don't have any VBA specific syntax and Github-Linguist (the GitHub service that calculates the language statistics) looks only at the content and extension of a file to determine the language used for that file.

To solve this issue and make sure that files in this repo are correctly identified as VBA, there are a mainly 3 options:

A. Add the language information as a comment at the top of the file.

This is the best option in my opinion. ie.:

Attribute VB_Name = "ComponentName"
'@Lang VBA

I was planning on making a script to fix that automatically on all files that need it, so if you are interested, let me know.

B. Add the following in the .gitattributes file:


*.bas linguist-language=vba

The advantage of this method is that you only have to make the change in one place. The disadvantage is that this won't solve the problem for GitHub searches because the linguist-language attribute is not supported for searches. This means that if the VBA language filter is used in a search query, files that are currently labelled as VB6 still won't show up.

C. Change the file extension from .bas to .vba

That second extension avoids any ambiguity between VBA and VB6, but you won't be able to use the simple Export feature of the VBE since you'll need to perform the renaming on every export.

ClimberMel commented 4 months ago

I think the first option is best.  Just adding the language identifier to the files.  Using gitattributes would be a quick fix, but I like the other as a better long term fix.Sent from my Galaxy -------- Original message --------From: Martin Leduc @.> Date: 2024-07-07 3:27 p.m. (GMT-08:00) To: ClimberMel/SMF_Add-in @.> Cc: Subscribed @.> Subject: [ClimberMel/SMF_Add-in] Automatic Language Detection (Issue #86) Currently, this repo is marked as a Visual Basic 6.0 (VB6) repo since more than 50% of the code is indentified as VB6. image.png (view on web) The reason for it is that a lot of code modules in this project don't have any VBA specific syntax and Github-Linguist (the GitHub service that calculates the language statistics) looks only at the content and extension of a file to determine the language used for that file. To solve this issue and make sure that files in this repo are correctly identified as VBA, there are a mainly 2 options: A. Add the language information as a comment at the top of the file. This is the best option in my opinion. ie.: Attribute VB_Name = "ComponentName" @. VBA I was planning on making a script to fix that automatically on all files that need it, so if you are interested, let me know. B. Add the following in the .gitattributes file: *.bas linguist-language=vba

The advantage of this method is that you only have to make the change in one place. The disadvantage is that this won't solve the problem for GitHub searches because the linguist-language attribute is not supported for searches. This means that if the VBA language filter is used in a search query, files that are currently labelled as VB6 still won't show up.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>