Custom code smell test.

I have a test for a Java/JSP/etc. application that I'd like Team City to run.

I have a tag that I use for including js and css files, the tag will append a random string as a get parameter every time the file has been changed so I don't have problems with browser caching. This works well, but it also means that anywhere in my application that I am using an html link or a script tag to include javascript that I will eventually have an error.

Where do I start testing for this? I want to run a test that alerts me any time a developer uses one of these tags incorrectly. What kind of plugin should I write, is there an easier way to test for this than to write a plugin?

1 comment
Comment actions Permalink


Error-finding logic in the code is not the level TeamCity generally operates on, so the logic should probably come from some tool (e.g. hand-written one) that you can run in the build and then instruct TeamCity to fail a build when an error is found in the code.

TeamCity has one code inspection tool bundled: IntelliJ IDEA. In theory, you can write a plugin for IDEA and then add the plugin to TeamCity-bundled IDEA distribution so that inspectinos build would report the error as code inspection. However, this seems to big a hazzle to cover single code sanity check.


Please sign in to leave a comment.