LDraw.org Discussion Forums

Full Version: Official part file validator
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
My favorite Google translater says "nicken" in German...
Ok, it is not an abbreviation, it is an english word Smile - Thanks!
What I'd really like to see would be a cross-platform command-line version of DATHeader that could be used for automatic checking. Print errors/warnings/notes to stdout and with a switch, write a corrected dat file to the specified file path. Such a thing could be easily enough be hooked to a web application, the parts tracker or whatever other uses there could be.

EDIT: I humbly congratulate Mike on his 2^10th post.
Ups, so many posts already.

You asked for "cross-platform command-line version of DATHeader". DATHeader is written in VB.NET. If somebody like to translate the code into "something "cross-platform" I'll help. But I can not write c or java. Sad

Edit: I just attached the sourcecode for the function ScanForHeaderErrors to this post, so you will see the bad coding behind Smile
I assume running through a browser is fine, so I'd prefer to convert it to Perl and incorporate it into the Parts Tracker as a replacement for the existubf L3P scrip on the Tools page. Do you have a full spec. of what DATheader current does? As I said, much of the header checking already exists.
A full spec. of all tests for DATHeader are currently not available because it is not necessary, I have the sourcecode Smile
The spec would have been double work.

But I use an object for the header errors. Hopefully the entries are self explaining. If not, please let me know:

Structure ResultHeader
Dim gboolCorrectLengthofPartDescription As Boolean 'Checks for greater 1 and less max. characters.
Dim gboolNoTabinPartDescription As Boolean 'Checks for Tab Character in part description
Dim gboolLeadingSpacesInPartDescription As Boolean
Dim gboolCorrectKeywordLength As Boolean
Dim gboolCorrectKeywordUsed As Boolean
Dim gboolUniqueKeywordUsed As Boolean
Dim gboolCorrectHelpLength As Boolean
Dim gboolPartDescriptionMatchesFilename As Boolean
Dim gboolAuthorRealnameSet As Boolean
Dim gboolAuthorUsernameSet As Boolean
Dim gboolBFCisSet As Boolean
Dim gboolLicenseisSet As Boolean
Dim gboolPartTypeisSet As Boolean
Dim gboolNewNotUsed As Boolean
Dim gboolNeedsWorkComment As Boolean
Dim gboolCategory As Boolean
Dim gboolCategoryAllowed As Boolean
Dim gboolKeywordsAllowed As Boolean
Dim gboolPrimitive48FilenameStartwith48 As Boolean
Dim gboolPrimitivePartDescriptionStartWithout_orTilde As Boolean
Dim gboolSubpartFilenameStartWithS As Boolean
Dim gboolPartFilenameStartwithout48orS As Boolean
Dim gboolSubpartDescriptionStartWithTilde As Boolean
Dim gboolSubpartDescriptionStartWithout_ As Boolean
Dim gboolPartDescriptionStartWithout_ As Boolean
Dim gboolShortCutPartDescriptionStartWith_ As Boolean
Dim gboolShortCutFilenameContains_d_or_c As Boolean
Dim gboolBFC_CCW_at_Primitive As Boolean
Dim gboolNameExtensionIsDAT As Boolean
Dim gboolNoSpecialCharacterInDescription As Boolean
Dim gboolLineEndWithCRLF As Boolean
Dim gboolRotationNotFound As Boolean 'Checks for word ROTATION
Dim gboolHistoryEntryAuthorBracket As Boolean 'Checks for UserName in History Entry with Brackets
Dim gboolMinifigAccessoryNotFound As Boolean ''Checks for Minifig Accessory in Filedescription
Dim gboolFigureAccessoryNotFound As Boolean 'Checks for Figure Accessory in Filedescription
Dim gboolSquarebracketsAroundUsername As Boolean
Dim gboolAliasPartDescriptionStartWithSame As Boolean 'Checks for Alias parts to start with =
Dim gboolPhysicalColorPartMentionColorInDescription As Boolean 'Checks for physical color part to mention the color [71]
Dim gboolPhysicalColorPartOnlyLinetype1Used As Boolean 'Checks for physical color part only to consists of a linetype 1
Dim gboolPhysicalColorPartCorrectColorsUsed As Boolean
Dim gboolAliasPartOnlyLinetype1Used As Boolean
Dim gboolAliasPartOnlyOneLinetype1 As Boolean
Dim gboolAliasPartOnlyColor16Used As Boolean
Dim gboolAliasPartAliasMentionedInComments As Boolean
Dim gboolAliasPartAliasNumberInComment As Boolean
Dim gboolNoAmericanEnglishUsed As Boolean
End Structure
I'd like to move forward on this. To all the experienced Web developers out there what is the best language solution for this? JavaScript? Perl? Something else?
I think a serverside solution would be the best option - you could hook that onto the Parts Tracker, so JavaScript wouldn't be a very good idea.
Yes, I was planning on Perl, as the header checking part of it is already written in Perl. Maybe I'll get some free time later this month!
Pages: 1 2