Skip to content

Commit 8c57bed

Browse files
authored
Merge pull request #3718 from rkapka/rkapka-master
Configuration defaults are now all in the .settings file.
2 parents d865d10 + c865400 commit 8c57bed

File tree

157 files changed

+951
-875
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+951
-875
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System.Collections.Generic;
2+
using Rubberduck.Parsing.Inspections.Abstract;
3+
4+
namespace Rubberduck.Inspections
5+
{
6+
public interface IInspectionProvider
7+
{
8+
IEnumerable<IInspection> Inspections { get; }
9+
}
10+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System.Collections.Generic;
2+
using System.Linq;
3+
using Rubberduck.Parsing.Inspections.Abstract;
4+
using Rubberduck.Settings;
5+
6+
namespace Rubberduck.Inspections
7+
{
8+
public class InspectionProvider : IInspectionProvider
9+
{
10+
public InspectionProvider(IEnumerable<IInspection> inspections)
11+
{
12+
var defaultSettings = new DefaultSettings<CodeInspectionSettings>().Default;
13+
var defaultNames = defaultSettings.CodeInspections.Select(x => x.Name);
14+
var defaultInspections = inspections.Where(inspection => defaultNames.Contains(inspection.Name));
15+
16+
foreach (var inspection in defaultInspections)
17+
{
18+
inspection.InspectionType = defaultSettings.CodeInspections.First(setting => setting.Name == inspection.Name).InspectionType;
19+
}
20+
21+
Inspections = inspections;
22+
}
23+
24+
public IEnumerable<IInspection> Inspections { get; }
25+
}
26+
}

RetailCoder.VBE/Properties/Settings.Designer.cs

Lines changed: 168 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)