1

I'm actually working on a tool that need some configuration before it can be used. To save some time a hard coded some values into the text boxes of the configuration tab, so I don't have to renter them every time I do some testing or debugging.

As we're using TFS to manage our solutions I'm wondering if there is a way to mark those hard coded elements in some way so that TFS or Visual Studio 2008 will remind me to remove/replace them before I do a check in.

UPDATE:

The todo comments won't be a real solution as we're already using it to mark code segments which have to be reworked. We use it as a reminder for longterm tasks. And we have plenty of them so this might become a little bit unclear.

Mathew Thompson
  • 55,877
  • 15
  • 127
  • 148
Flo
  • 27,355
  • 15
  • 87
  • 125
  • Maybe consider editing your question to include the fact that todo comments won't work for your situation. Just an idea... – Jagd Aug 26 '09 at 18:35

3 Answers3

3

Some options:

  1. write a custom checkin policy
  2. use the existing FxCop checkin policy and write a custom rule (if you're marking TODOs with something that gets actually compiled, like an Attribute)
  3. ditto, but via the StyleCop checkin policy (if your TODOs are source comments)
Richard Berg
  • 20,629
  • 2
  • 66
  • 86
2

Probably not the perfect solution, but Visual Studio let's you add TODO comments that may work well enough for you.

RichardOD
  • 28,883
  • 9
  • 61
  • 81
  • The todo comments won't be a real solution as we're already using it to mark code segments which have to be reworked. We use it as a reminder for longterm tasks. And we have plenty of them so this might become a little bit unclear. – Flo Aug 26 '09 at 12:40
  • You can use a different tag than TODO. If you go to Options -> Environment -> Task List you can add new tags. One could be Pre-Build. – Ryan Aug 27 '09 at 12:46
  • @Ryan- that's a good suggestion. @Flo- I tend to use the ObsoleteAttribute a lot when reworking code- http://msdn.microsoft.com/en-us/library/system.obsoleteattribute.aspx – RichardOD Aug 27 '09 at 19:17
0

You could write a unit test that fails when the hardcoded stuff is found. Obviously, you won't get a reminder before checking in but you do get a build failure afterwards.

grenade
  • 31,451
  • 23
  • 97
  • 126