Skip to content

Commit

Permalink
#Fix 28 & Update #16 adding of fortran 77 files extensions and more.
Browse files Browse the repository at this point in the history
Added files extensions to fortran 77 as defined in #28.
Adjusted the Analyzer to handle both situation where the contributor
included the dot before the format extension and not.
  • Loading branch information
Omar WALDMANN committed Jun 2, 2017
1 parent 8a33892 commit a78e77c
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,17 @@ public List<CheckResult> check(List<File> pInputFiles, List<String> pLanguageIds
final List<String> allowedExtension = new ArrayList<>();
for (IConfigurationElement fileExtension : analyzerContribution
.getChildren(ANALYZER_EP_ELEMENT_FILE_EXTENSION)) {
allowedExtension.add(fileExtension
.getAttribute(ANALYZER_EP_ELEMENT_FILE_EXTENSION_ATTRIBUTE_NAME));
// we remove the dot in case the contributor added it.
if (fileExtension
.getAttribute(ANALYZER_EP_ELEMENT_FILE_EXTENSION_ATTRIBUTE_NAME)
.contains(".")) {
allowedExtension.add(fileExtension
.getAttribute(ANALYZER_EP_ELEMENT_FILE_EXTENSION_ATTRIBUTE_NAME)
.replace(".", ""));
} else {
allowedExtension.add(fileExtension
.getAttribute(ANALYZER_EP_ELEMENT_FILE_EXTENSION_ATTRIBUTE_NAME));
}
}
// 1.2. Restricting analysis only on file that the plugin can
// handle.
Expand Down
36 changes: 36 additions & 0 deletions fr.cnes.analysis.tools.fortran77.analyzer/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,24 @@
<fileExtension
name="f">
</fileExtension>
<fileExtension
name="fpp">
</fileExtension>
<fileExtension
name="ftn">
</fileExtension>
<fileExtension
name="F">
</fileExtension>
<fileExtension
name="FPP">
</fileExtension>
<fileExtension
name="FTN">
</fileExtension>
<fileExtension
name="FOR">
</fileExtension>
</analyzer>
<analyzer
extensionId="fr.cnes.analysis.tools.fortran77.rule"
Expand All @@ -26,6 +44,24 @@
<fileExtension
name="f">
</fileExtension>
<fileExtension
name="fpp">
</fileExtension>
<fileExtension
name="ftn">
</fileExtension>
<fileExtension
name="F">
</fileExtension>
<fileExtension
name="FPP">
</fileExtension>
<fileExtension
name="FTN">
</fileExtension>
<fileExtension
name="FOR">
</fileExtension>
</analyzer>
</extension>
</plugin>

0 comments on commit a78e77c

Please sign in to comment.