It is currently April 26th, 2024, 10:29 am

Skin INI Validator and Bracket Matcher Program

Share and get help with Plugins and Addons
MattKing
Developer
Posts: 98
Joined: August 6th, 2009, 3:03 pm

Skin INI Validator and Bracket Matcher Program

Post by MattKing »

Edit: You will need .NET, probably 3.5 I'm really not sure.

Up late again, was thinking about how annoying it is to track down errors in skins so I made a little utility to check for some errors.

Right now it checks for:
  • unmatched brackets,
    possibly unmatched ##,
    check for multiple sections of the same name,
    check for multiples keys in the same section with the same name.
One problem is that it will only find the first section with same name as another and return that error, same for the multiple keys.
But it will always return mismatched brackets and ##.

For example:

Code: Select all

[Measure1]
Meter=meter
Meter=meter

[Measure1]
Meter=meter
This will only return that there is duplicate keys in [Measure1] and not return the fact that theres two sections with the same name.

Code: Select all

[Measure1]
Meter=meter

[Measure1]
Meter=meter

[Measure2]
Meter=meter

[Measure2]
Meter=meter
This will only return that there is duplicate sections[Measure1] and not return the fact that theres two other sections with the same name.

Code: Select all

[Background]
Meter=IMAGE
SolidColor=0, 0, 0, 150
X=0
Y=0
W=1680
H=70
LeftMouseDownAction=!execute [I'm Bad at brackets]]]
This will return:
Found unmatched [] at line: 8. Column number 50.
LeftMouseDownAction=!execute [I'm Bad at brackets]]]

It's command line and takes the parameter -path

so something like

Code: Select all

SkinChecker -path "My path With Spaces.ini"
User avatar
BrianHeston
Posts: 26
Joined: September 4th, 2009, 1:52 am

Re: Skin INI Validator and Bracket Matcher Program

Post by BrianHeston »

I was just pondering the idea of someone building a syntax checker plugin for Notepad++ that would work for Rainmeter INI files. What a bizarre coincidence... Do you have any idea how easy it might be to turn your program into a Notepad++ plugin?
MattKing
Developer
Posts: 98
Joined: August 6th, 2009, 3:03 pm

Re: Skin INI Validator and Bracket Matcher Program

Post by MattKing »

BrianHeston wrote:I was just pondering the idea of someone building a syntax checker plugin for Notepad++ that would work for Rainmeter INI files. What a bizarre coincidence... Do you have any idea how easy it might be to turn your program into a Notepad++ plugin?
I can't turn into a notepad++ program but I can give you things that are nice if you're using notepad++.

userDefinedLang!

Its awesome, but not really done I don't have time to finish it now but it will be done at some point.


And here is the file.
http://dl.dropbox.com/u/24968/userDefineLang.xml

Depending on how you installed notepad++ you'll have to put it in different places.

Right now it recognizes a whole bunch of Rainmeter keywords, constants and stuff like that. It matches up [] and () in a way.. like in programing with {} braces.
User avatar
BrianHeston
Posts: 26
Joined: September 4th, 2009, 1:52 am

Re: Skin INI Validator and Bracket Matcher Program

Post by BrianHeston »

Cool! I'll have to play around with that. Thanks for sharing it! :D
User avatar
maminscris
Posts: 509
Joined: April 24th, 2009, 3:17 pm
Location: Bucharest, Romania Lat 44,43° Lon 26,1°

Re: Skin INI Validator and Bracket Matcher Program

Post by maminscris »

and where do i put that in notepad++? in the main folder, in localization or in plugins? in app data?
Zero at programing, zero at writing codes, so far 2 at making images
But I'm good at copy/paste, and I not always like this
Image
User avatar
jsmorley
Developer
Posts: 22630
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Skin INI Validator and Bracket Matcher Program

Post by jsmorley »

Here is another custom version of UserDefineLang.xml that I have been using for a long time that does all the syntax highlighting without looking like something Walt Disney came up with on an acid trip... ;-)
userDefineLang.zip
MattKing
Developer
Posts: 98
Joined: August 6th, 2009, 3:03 pm

Re: Skin INI Validator and Bracket Matcher Program

Post by MattKing »

jsmorley wrote:Here is another custom version of UserDefineLang.xml that I have been using for a long time that does all the syntax highlighting without looking like something Walt Disney came up with on an acid trip... ;-)
userDefineLang.zip
Why I oughtta...
User avatar
jsmorley
Developer
Posts: 22630
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Skin INI Validator and Bracket Matcher Program

Post by jsmorley »

MattKing wrote: Why I oughtta...
Well I think defining this as your cursor:

Image

And this for underlining:

Image

Might be a bit much... LOL
oni5115
Posts: 27
Joined: October 4th, 2010, 3:33 pm

Re: Skin INI Validator and Bracket Matcher Program

Post by oni5115 »

Thank you for the XML, took me a while to figure out where to put it (using notepad++ portable). For those using Portable it goes under "PortableApps/Notepad++ Portable/App/Notepad++/"

That said I was wondering how to make it support themes. If at all possible. When I first turned it on I was like OMG MY EYES - because I have been using the dark theme Blackboard. Once I switched it back to normal everything was great. Worst case scenario I guess I can simply change the color codes in the XML, but I was wondering how the other languages support themes. Never really looked into doing any of that before.

I will probably also be checking out the syntax checker. I know I had a bit of an issue a while ago and had #Bracket Mismatch Error# I had been renaming a bunch of variables with auto-replace and then adding some features and literally had no clue where in my 1500+ line config file it was at. Good thing I had a backup and a diff viewer. :D But next time I can just run the syntax checker.
Everyone loves the [url=http://db.tt/qV9oIZZ]Dropbox[/url]!