Hosting StyleCop in a custom environment
I want to host a StyleCop in a custom environment, the example code provided in the SDK uses this one foreach(string myProject in this.myProjects)
. String
does not have the same properties as Path.GetHashCode()
and FilesToAnalyze
, does anyone know what it is this.myProjects
?
List<CodeProject> projects = new List<CodeProject>();
// what is this.myProject?
foreach (string myProject in this.myProjects)
{
CodeProject project = new CodeProject(
myProject.Path.GetHashCode(), myProject.Path, configuration);
// Add each source file to this project.
foreach (string sourceFilePath in myProject.FilesToAnalyze)
{
console.Core.Environment.AddSourceCode(project, sourceFilePath, null);
}
projects.Add(project);
}
source to share
After looking at the example in the SDK, I think this myProject
is just a placeholder to indicate how to build an instance CodeProject
.
If you like, you can define the class as shown below, or store the root path and files for analysis in a different data structure.
public class MyProject
{
public string Path { get { ... } }
public IEnumerable<string> FilesToAnalyze { get { ... } }
}
source to share