cancel
Showing results for 
Search instead for 
Did you mean: 

Code alignment in Units

SOLVED
shankar_r
Community Hero

Code alignment in Units

Hi,

 

I have installed TD in 2 machines, One machine[#1] TC having tab count as 6 in another machine[#2] on having count as 4 like below1.PNG2.PNG

 

 

 

 

 

 

 

I have edited some scripts created in #1 from #2 machine.

 

And committed code into Git hub.

 

But the looks like below.  I don't see any difference in TC alignment in both mahicne's TC

Code Beautifier.PNG

 

Is there any way to make it better in formating or aligning the code in code Editor?

 

I'm using TC 12.30 


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

1 ACCEPTED SOLUTION

Accepted Solutions
tristaanogre
Community Hero

Re: Code alignment in Units

It almost looks like there are tab characters being used even though you don't have that item checked.  I'm not sure what Git Hub does when importing code files, if it attempts to replace spaces with tabs or if, when you edit in Git Hub, it uses tab characters.

 

Your settings in TestComplete looks right... however, it's a good rule of thumb to keep the same setup on multiple machines so you don't end up with mismatched formatting alignments.

 

Another possibility could be encoding.  If one is using UTF-8 and another is using UTF-16, that could account for some differences as well.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

4 REPLIES 4
tristaanogre
Community Hero

Re: Code alignment in Units

It almost looks like there are tab characters being used even though you don't have that item checked.  I'm not sure what Git Hub does when importing code files, if it attempts to replace spaces with tabs or if, when you edit in Git Hub, it uses tab characters.

 

Your settings in TestComplete looks right... however, it's a good rule of thumb to keep the same setup on multiple machines so you don't end up with mismatched formatting alignments.

 

Another possibility could be encoding.  If one is using UTF-8 and another is using UTF-16, that could account for some differences as well.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

JuliaBernikova
Moderator

Re: Code alignment in Units

Hi Shankar,

 

I've referred to the screenshots, but still do not quite understand what the issue is. Could you describe it in more detail what improvements in the code formatting exactly you'd like to see? Where exactly do you observe problems with formating now: in TestComplete or in the tool you used to compare the scripts?

Julia Bernikova
SmartBear Customer Care Manager - TestComplete
shankar_r
Community Hero

Re: Code alignment in Units

I'm using tab in my scripts to indent, I'm able to see proper alignment in Test Complete with different setup But not in the Git Hub.

 

This maybe not related to Test Complete code formatting but just want to check here is this issue anything to do with TC.


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

tristaanogre
Community Hero

Re: Code alignment in Units

Yeah, I think it might be a Git Hub deal.  I'd check the text encoding and also make sure that Git Hub is not interpreting tab characters or doing it's own formatting.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
New Here?
Join us and watch the welcome video:
Top Kudoed Authors