mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00

committed by
Sebastien Ros

parent
25e334e66b
commit
f864fdc916
@@ -96,17 +96,27 @@ namespace MSBuild.Orchard.Tasks {
|
|||||||
.Elements(None);
|
.Elements(None);
|
||||||
|
|
||||||
foreach (var element in elements) {
|
foreach (var element in elements) {
|
||||||
var include = (element.Attribute(Include) == null ? null : element.Attribute(Include).Value);
|
var filePath = (element.Attribute(Include) == null ? null : element.Attribute(Include).Value);
|
||||||
bool isValid = string.IsNullOrEmpty(include);
|
bool isValid = IsValidExcludeFile(filePath);
|
||||||
if (!isValid) {
|
if (!isValid) {
|
||||||
string message = string.Format(
|
string message = string.Format(
|
||||||
"\"{0}\" element name for include \"{1}\" should be \"{2}\".",
|
"\"{0}\" element name for include \"{1}\" should be \"{2}\".",
|
||||||
element.Name.LocalName, include, Content.LocalName);
|
element.Name.LocalName, filePath, Content.LocalName);
|
||||||
AddValidationError(element, message);
|
AddValidationError(element, message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static bool IsValidExcludeFile(string filePath) {
|
||||||
|
var validExtensions = new[] { ".sass", ".scss", ".less", ".coffee", ".ls", ".ts", ".md", };
|
||||||
|
if (string.IsNullOrEmpty(filePath)) return true;
|
||||||
|
|
||||||
|
var fileExtension = Path.GetExtension(filePath);
|
||||||
|
if (string.IsNullOrEmpty(fileExtension)) return false;
|
||||||
|
|
||||||
|
return validExtensions.Contains(fileExtension, StringComparer.InvariantCultureIgnoreCase);
|
||||||
|
}
|
||||||
|
|
||||||
private void CheckCodeAnalysisRuleSet(XDocument document) {
|
private void CheckCodeAnalysisRuleSet(XDocument document) {
|
||||||
const string orchardbasiccorrectnessRuleset = "OrchardBasicCorrectness.ruleset";
|
const string orchardbasiccorrectnessRuleset = "OrchardBasicCorrectness.ruleset";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user