Jump to content

New Beta Tidy.exe


Jos
 Share

Recommended Posts

You seriously have files that have partially CRLF and partially CR or LF?

Of course not. This is edge case.

On the other hand I'm strongly for a user configurable line ending option. The same way as the tab vs. space indentation. This will complete the white space handling.

Edited by stoyan

; Opt('MustDeclareVars', 1)

Link to comment
Share on other sites

  • Replies 71
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Developers

Tidy has always produced outputfiles with CRLF and will remain doing that.

I will make the change so its irrelevant if the input files contains consistent of mixed line ending.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

Uploaded v 2.2.0.3 to the beta directory:

- Support Mixed Line Endings
- Tidy variable name case for variables defined in the Constants included files.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Tidy has always produced outputfiles with CRLF and will remain doing that.

I won't argue on that nor insist. It's a longstanding decision of yours probably justified. Probably this is not the first complain about the output Tidy produces and won't be the last. Every one of us has an unique coding style and satisfy everyone is imposible.

I think this is reasonable for a Windows application to do.

It is not about the OS it is about coding style, personal likings and freedom to choose. Let's stick with 8 char tabs because Notepad (Tidy handles it perfectly) and camel cased file and folder names because of Program Files, Documents and Settings, Desktop.ini and Thumbs.db. One can stick it, but I do not. This has nothing to do with the operating system it's all about being you, your likings, being creative, expressing yourself, and be satisfied of the fruits of your labor.

Isn't that why tidy.ini is in the first place?

This thread is about testing new Tidy not discussing the output so apology for the off-topic.

Edited by stoyan

; Opt('MustDeclareVars', 1)

Link to comment
Share on other sites

It is not about the OS it is about coding style, personal likings and freedom to choose.

Fine, then maybe I should choose the null character for my line endings and see how that goes?

Let's stick with 8 char tabs because Notepad (Tidy handles it perfectly) and camel cased file and folder names because of Program Files, Documents and Settings, Desktop.ini and Thumbs.db. One can stick it, but I do not.

I'm sorry that you waste so much time fighting battles that are pointless. I used to fight the same battles until I realized something: I was spending more time trying to get the operating system to do something the way I wanted than I was spending time on doing the something in the first place. With experience (or age) I've learned to pick and choose my battles and that some battles are entirely pointless except in principal. I'm not really interested in fighting too many battles on principal; I'm more interested in practical results. I find this policy gets a lot more done.

This has nothing to do with the operating system it's all about being you, your likings, being creative, expressing yourself, and be satisfied of the fruits of your labor.

You're aggrandizing line end characters just a little bit, don't you think? There's nothing creative about being contrary. Actually contrariness is rather trite and unoriginal. The fruits of my labor is the logic of the code itself, not how pretty it is.

Isn't that why tidy.ini is in the first place?

The purpose of Tidy is to normalize scripts into a consistent format. Line endings are a non-visible part of this normalization. On Windows the (documented) standard line ending sequence is CRLF. An option would certainly be trivial to implement but often trivial things end up being superfluous.
Link to comment
Share on other sites

  • Developers

I won't argue on that nor insist. It's a longstanding decision of yours probably justified. Probably this is not the first complain about the output Tidy produces and won't be the last. Every one of us has an unique coding style and satisfy everyone is imposible.

It is not about the OS it is about coding style, personal likings and freedom to choose. Let's stick with 8 char tabs because Notepad (Tidy handles it perfectly) and camel cased file and folder names because of Program Files, Documents and Settings, Desktop.ini and Thumbs.db. One can stick it, but I do not. This has nothing to do with the operating system it's all about being you, your likings, being creative, expressing yourself, and be satisfied of the fruits of your labor.

Isn't that why tidy.ini is in the first place?

This thread is about testing new Tidy not discussing the output so apology for the off-topic.

So your proposal would be to keep the similar (mixed) line ending in the output file as found in the input file or have a choice what the new line ending character(s) should be?

For me, Tidy is all about standardizing the source file to a better readable standard and consistent structure.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

No, I had in mind explicit user definable settings the same way as 'tabchar' is for the indentations. I'm not against standardization of the output. If the source is to be published one can rename his/her 'tidy.ini' file and use the community/dev team agreed defaults. This will result in a kind of output profiles: the "mine" one kept in the ini file and "default" used when no 'tidy.ini' is present.

; Opt('MustDeclareVars', 1)

Link to comment
Share on other sites

Not sure if this is a problem but I think it may be with the 4096 limit removed.

Global $array[648][2]

Global $array[232][2]

Current tidy reports

### Tidy Error: Concatenated Script line longer than 4095.

### Tidy Error: Tidy run abandoned!

Beta 2.2.0.3 hangs (5 minutes)

EDIT:

I shortened the array, and current tidy completes without error, while beta still hangs.

here is my current shorter test array.

Global $array[232][2] = [[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0], _
        [123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0],[123456789, 0]]

Win 7 &86

EDIT: shortened array

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

  • Developers

Uploaded v 2.2.0.4 to fix the reported bug by JohnOne.

Thanks

Jos ;)

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Great, works fine.

Forgive me if this is the wrong place, but is obfuscator related to tidy in some fashion?

I ask because obfuscator still errors out with...

!Obfuscator Error: A line exceeds max lenght of 4096. This needs to be changed to allow string encryption!

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

  • Developers

Great, works fine.

Forgive me if this is the wrong place, but is obfuscator related to tidy in some fashion?

I ask because obfuscator still errors out with...

The only relation is that when I created Obfuscator I used the Tidy source as the base to build Obfuscator as it had already the Syntax lexing build in it.

So Obfuscator still has the limitations as before and it might be another project I work on some day but nothing else currently planned than to finish Tidy first.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

Uploaded a new Beta v 2.2.0.5 to fix an issue when /Proper=0 was used and added the /ProperConstants option and set its default to 0/off because this function will slow down the tidy process. The /ProperConstants option will read through all #Included files and filter the "Global Const" variable to propercase them in the script.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I believe I found a bug.

Switch ($var1 = 1) and ($var2 = 1) and ($var3 = 1) ; the logicalAnds stay the same
    Case 1

    Case 0
EndSwitch



Switch ($var1 = 1) And $var2 = 1 and ($var3 = 1) ; just one logicalAnd capitalized
    Case 1

    Case 0
EndSwitch



Switch $var1 = 1 And $var2 = 1 And $var3 = 1 ; here they both capitalized correctly
    Case 1

    Case 0
EndSwitch
Edited by jaberwocky6669
Link to comment
Share on other sites

  • Developers

I believe I found a bug.

Yeap... this was already present in the previous versions and just never discovered yet.

Uploaded v2.2.0.6 that fixes this.

Thanks

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Feature Request?

An option to not allow Tidy to remove all of the spaces. For example:

; I want these to stay put after I run Tidy (they aren't formatting right in the forum though -- imagine the '=' were lined up all in a column)
Global Const $asdf  = 1
Global Const $asdfasdf  = 2
Global Const $asdfasdfasdf  = 3
Global Const $adsfasdfasdfasdf  = 4
Global Const $asdfasdfasdfasdfasdf = 5
Global Const $asdfasdfasdfasdf  = 6

Ok, nevermind! Wow I missed that one!

Edited by jaberwocky6669
Link to comment
Share on other sites

For some reason, when this is in a script by itself with properconstants=1, Tidy crashes. Tidy seems to work on some other scripts. And this code will tidy up when placed with other code. I thought it had something to do with the underscores but I took those out and it still crashed Tidy.

; author: progandy
#include<WinAPI.au3>
$tGUID = _WinAPI_GUIDFromString("{6B29FC40-CA47-1067-B31D-00DD010662DA}")
MsgBox(0, 'Result: $tagGUID', _
    StringFormat("%04X-%02X-%02X-%s", _
    DllStructGetData($tGUID, 1), _
    DllStructGetData($tGUID, 2), _
    DllStructGetData($tGUID, 3), _
    Hex(DllStructGetData($tGUID, 4)) _
    ) _
)

Here's my full ini:

[ProgramSettings]
*** Indent 0 = Tabs >0 = Number of Space
tabchar=0

*** Update Functions/Keywords/Macros/UDFs to Proper case
proper=1

 * * * Update Constants defined in the "constant Include files"
properconstants=1

*** Update Variables to: 1=LowerCase; 2=UpperCase; 3=First Dim/Local/Global or "First_Seen" Case
vars=3

*** Update Spaces around Delimiters
delim=0

*** Added comment to EndFunc statement e.g. "EndFunc ;==>UDF_Name"
endfunc_comment=1

*** Generate Documentation file for the Program and optionally Display it with Notepad at the end ot the Tidy run
Gen_Doc=0
Gen_Doc_Show=0

*** Keep x Version of the File before the Tidy run and optionally store them in SubDirectory "\Backup" 
KeepNVersions=5

*** Target backup directory which defaults to Scriptdir\Backup. Any other directory needs to exist or else it will use the default directory!
backupDir=

*** Remove Empty lines from Script Source
Remove_Empty_Lines=

*** 1=Show Tidy Errors in Console 9=Debug Output
ShowConsoleInfo=

*** Run DIFF program at the end of the Tidy run to show the difference between original and new program.
xShowDiffPgm=C:\Progra~1\WinMerge\winmerge.exe "%new%" "%old%"

Update: When I comment out the #include line it works.

Update: When I take everything out but the #include it still crashes.

Update: THis only happens when I create a brand new au3.

What is properconstants? I don't understand what it does from the comment in the ini.

Ok, so it has nothing to do with the code but something to do with the includes. Only happens on files created after I changed properconstants to 1.

Edited by jaberwocky6669
Link to comment
Share on other sites

  • Developers

It crashes for me too so I will have a look at it to see what is happening.

This is the description I put on the first page for this feature...does that explain it?

- Set variable name case for variables as defined in the Constants included files.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...