Can TFS or Visual Studio remind me about issues that have to be marked as completed before a check in - visual-studio

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.

Some options:
write a custom checkin policy
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)
ditto, but via the StyleCop checkin policy (if your TODOs are source comments)

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

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.

Related

How to automate applying solutions that VS quick action offer to solve Stylecop(roslyn) code style errors

I'm introduce stylecop functionality with custom rule set in massive application that contain more than 100 projects. Roslyn compiler show errors and warnings in existing code and VS offers common fixes (quick actions). You press Ctrl+. and see fixes. It's so tedious and time-consuming operation select error, press shortcut and applying rule, when you have 100+ project.
I want to automatic apply the rules that in the list. Maybe some script that goes through error list, check that error id exist in list and apply that rule on project.
I hear about Visual Studio Extensions, can they help me? Can someone advise me how can I solve this problem?
The Visual Studio Code Cleanup (find it in the Analyze menu) has a Code Cleanup option. You can configure a profile with the Fixers you want to run and the have it blast through a complete solution.
Save the profile with the fixers you want, then choose Run Code Cleanup (Profile) on Solution.

How to group excluded from source control files (TFS, Visual Studio)

Is it possible to group them to a folder (or workitem) or something similar, and how?
edit:
I am asking because sometimes when working on a task I need to jump to another and check in only the other task changes and exclude all others. Later when I get back to the first one I want to be able to resume the work in progress. It is OK if I only jump between two tasks, but if there are 3 and more changes (on a particular task) cannot be tracked fast.
I searched SO but did not find answer, also vs ui does not seem to provide the option.
Visual Studio 2017 Enterprise,
Microsoft Visual Studio Team Foundation Server
Version 15.117.26714.0
What you are doing is not a recommend way in TFS. It's not the really usage of excluded list.You should use Shelveset instead.
Sometimes you need to set aside some or all of your work in progress. Shelvesets are useful when you want to stop work for:
Interruption: You have pending changes that are not ready for check in, but you need to work on a different task.
Collaboration: You have pending changes that are not ready for check in but you need to share them with another team member.
..
You could simply suspend and resume your work from the My Work page, more details please refer this tutorial--Suspend your work and manage your shelvesets

How to make the TFS build fail when number of warnings is increased compared to the last build

I am new to TFS. (using TFS 2012 and vs 2008)I may be asking some very basic questions. How to make the TFS build fail when number of warnings is increased compared to the last build? I am willing to write vbscript/perl for it.
Finally I also want track also is there a new warning type compared to the last build?
If some guidance is provided.
Will it better be integrated as postbuild event?
Do i need to create a new Build Quality(in msft jargon)?
Check below article explaining how to do that. It has link to the Xaml file as well.
http://blog.stangroome.com/2011/03/28/fail-a-build-when-the-warning-count-increases/
You might be able to use something similar for your second question about warning type as well.

Tips on making accidental Visual Studio project changes more difficult?

my team uses Visual Studio for our development environment, we like it very much
we use the same project files in our automated build
our problem is that it's so easy to make changes in visual studios UX that get applied to the project files. we're seeing frequent build breaks
...I know...I know... dont submit them to the repro!
I wish I could convince everyone to be more careful, but lets be honest - it's very easy given the number of permutations {x86,x64,any} {release,debug}
My question: Is there anything I can add to a VS project that would make it more difficult to make changes? I'm not looking for a perfect solution, but the UX in VS works great up until a point, and then I'd prefer notepad to keep mistakes down
I could make the file read only, I dont know how that would play with our source control but I could investigate.
I'm hoping for something clever, maybe a mode that would prompt for confirmation before changing?
ideas / tips?
Bring a piggy bank to the office. If a user commits a file that breaks the automated build, then that person has to add $1 to the piggy bank. At the end of the project, or when the pot reaches a particular amount, buy something for the team and print up a sheet showing how much each person "contributed" to the pot.
You should check visual studio for options so that check out and check in are explicit.
You can also add check in policies, which among other can demand that a clean build was done locally before checking in.
If you would like more help, you should add some information both about your current setup and what you would like to prevent and what you would like achieve.
I usually have the team lead check-out the project file and keep it locked. Then nobody else can check-in changes. It is a little lo-tech, but it worked each time we did it. A benefit to this approach is that, when a user tries to make a change to the project file, he/she gets a reminder right away (because it can't be checked-out).
If we need changes, the project lead makes the changes, checks-in and out right away.

Visual Studio 2010 / TFS set "local" comments?

I'm working in VS 2010 and am connected to a Team Foundation Server.
In order to edit source files I have to check them out from the server. After I'm done with editing, I have to check them back in (to make changes visible to everyone else) or discard changes.
I am currently in the process of getting acquainted with the architecture and systems, so I'd like to add a lot of personal comments while I play around with everything.
However I'd prefer to not make these comments visible to everyone else. (And I dont want to delete them everytime I commit changes via check-in)
Is there a VS function I did not yet discover or a plugin that allows me to enter comments that dont get commited to the TFS? Maybe something like virtual post-its, just something that lets me attach stupid reminders on certain blocks of code?
(yes I know, proper documentation would make this obsolete but the system is as it is and its huge and I'm not the one to document this all, just want to get used to the code)
VS2010/TFS2010 no built in functionality that I know of, for TFS2012 you could possibly use code reviews.
Maybe the Visual studio extension StickyNotes is what you want.

Resources