LDraw.org Discussion Forums
Official part file validator - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: General (https://forums.ldraw.org/forum-12.html)
+--- Forum: Official File Specifications/Standards (https://forums.ldraw.org/forum-32.html)
+--- Thread: Official part file validator (/thread-14401.html)



Official part file validator - Orion Pobursky - 2014-11-04

I'd like to see an official, web based, part validator in the vein of Mike Heidemann's DAT Header program. A simple web interface where a part author can submit a part and be served back an error list and possibly a fixed, error free part. I would gladly host such an app on the LDraw.org servers.


Re: Official part file validator - Santeri Piippo - 2014-11-04

Maybe even take a step further and replace the l3p checks on the PT with something like this. Unfortunately DATHeader was quite closed source last time I checked. Sad


Re: Official part file validator - Michael Heidemann - 2014-11-04

?????
I can't remember that question!


Re: Official part file validator - Roland Melkert - 2014-11-04

LDView could probably be modified to write it's finding to a log instead of it's error dialog as it's already present on the part tracker server I believe.


Re: Official part file validator - Travis Cobbs - 2014-11-04

The command line LDView could indeed be modified to output warnings and errors to a log file (or stdout/stderr) with relatively little effort.


Re: Official part file validator - Chris Dee - 2014-11-05

I agree.

The header checking already exists as a (more or less) self-contained script on the Parts Tracker and is used the the parts update build. I have resisted including that as a mandatory check upon file submission for fear of losing parts (and part authors) for want of a few simple corrections that can be done as admin edits.

But DATheader does a lot more...


Re: Official part file validator - Orion Pobursky - 2014-11-05

Yes. And I want something to automate the correction process as much as possible while also being completely browser based and therefore platform independent. Streamlining the system with good, platform agnostic tools is something that needed to happen years ago.


Re: Official part file validator - Chris Dee - 2014-11-05

I agree, but Mike has done a great job with DATheader in the absence of browser-based tools.


Re: Official part file validator - Willy Tschager - 2014-11-05

Chris Dee Wrote:But DATheader does a lot more...

nod

w.


Re: Official part file validator - Michael Heidemann - 2014-11-06

Please let me know the meaning of "nod".


Re: Official part file validator - Philippe Hurbain - 2014-11-06

My favorite Google translater says "nicken" in German...


Re: Official part file validator - Michael Heidemann - 2014-11-06

Ok, it is not an abbreviation, it is an english word Smile - Thanks!


Re: Official part file validator - Santeri Piippo - 2014-11-06

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.


Re: Official part file validator - Michael Heidemann - 2014-11-06

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


Re: Official part file validator - Chris Dee - 2014-11-06

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.


Re: Official part file validator - Michael Heidemann - 2014-11-07

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


Re: Official part file validator - Orion Pobursky - 2014-11-30

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?


Re: Official part file validator - Santeri Piippo - 2014-12-04

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.


Re: Official part file validator - Chris Dee - 2014-12-06

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!