Can TeamCity apply formatting?

The company where I'm contracting is considering the purchase of a large # of licenses of the commercial version of Jalopy to enforce formatting consistency across many different types of IDEs. As an alternative to this, does or will TeamCity give a way for the server to apply IDEA's formatting rules to all code as part of commit regardless of what IDE the commit is coming from?

10 comments
Comment actions Permalink

FYI - If TeamCity 2 can do this, I think TC can get adopted at this large client. If it can't yet do this, how fast can TC 2 get this capability?

0
Comment actions Permalink

Jon,

TeamCity is not sitting between developer's IDE and VCS, so it cannot enforce commit rules.
Instead, it can verify the quality of the committed code in terms of Inspection builds.

We can verify, for instance, that all class member variables are started with some prefix.

So, I'm afraid, TeamCity cannot help here (enforce formatting), or at least I see no way how to do it.

Regards,
KIR

0
Comment actions Permalink

As a form of inspection, could TC have a sort of scratch pad where it performs IDEA-setting formatting (controlled & run on the server, not in the IDE) and then checks to see if the formatted version of the file exactly matches the original file? It would be a way to make sure users have checked the "Reformat code" option on the "Before Check In" in the Commit Changes dialog and that they have the correct format settings exactly matching the server format settings.

0
Comment actions Permalink

Kirill,

You bring up the bigger issue that TC doesn't literally sit between the IDE & VCS. With intelligent plugin support in the IDE's, on attempted commit couldn't TC actively change the file if it doesn't match formatting or other things that can be automatically corrected, then send the now conforming version back to the IDE for the user to accept & re-commit? It seems like you already have most of the mechanisms you need to accomplish this.

Thanks,
Jon

0
Comment actions Permalink

With TeamCity 2.0 close to release in March, are you open to considering something like this for the post-2.0 TC roadmap?

0
Comment actions Permalink

Surely, we're ready to consider such features for post-Agra. So I'd appreciate if you post your ideas in our Jira/forum. We plan to make at least one post-Agra release this year, though I'm not sure about dates yet.

Kind regards,
KIR

0
Comment actions Permalink

Jon,

For now commit after remote run is performed by IDE and not by TeamCity server. So TeamCity server cannot apply formatting in this case. We consider moving commit feature to the server side, but it is technically difficult for some VCS like Perforce.

Kind regards,
KIR

--
Kirill Maximov
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Kirill,

Will do. Is that post-Agra release called Benares or as yet unnamed?

Thanks,
Jon

0
Comment actions Permalink

Yes, this is Benares :)

0
Comment actions Permalink

Okay, Kirill. The feature request:
http://www.jetbrains.net/jira/browse/TW-1686

Thanks,
Jon

0

Please sign in to leave a comment.