зеркало из https://github.com/github/codeql.git
Merge pull request #12190 from erik-krogh/fix-erb
JS: Actually extract `.html.erb` files.
This commit is contained in:
Коммит
f3f5f6eacf
|
@ -104,7 +104,7 @@ public class FileExtractor {
|
|||
|
||||
/** Information about supported file types. */
|
||||
public static enum FileType {
|
||||
HTML(".htm", ".html", ".xhtm", ".xhtml", ".vue", ".hbs", ".ejs", ".njk", ".html.erb") {
|
||||
HTML(".htm", ".html", ".xhtm", ".xhtml", ".vue", ".hbs", ".ejs", ".njk", ".erb") {
|
||||
@Override
|
||||
public IExtractor mkExtractor(ExtractorConfig config, ExtractorState state) {
|
||||
return new HTMLExtractor(config, state);
|
||||
|
@ -120,6 +120,12 @@ public class FileExtractor {
|
|||
if (isBinaryFile(f, lcExt, config)) {
|
||||
return false;
|
||||
}
|
||||
// for ERB files we are only interrested in `.html.erb` files
|
||||
if (FileUtil.extension(f).equalsIgnoreCase(".erb")) {
|
||||
if (!f.getName().toLowerCase().endsWith(".html.erb")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return super.contains(f, lcExt, config);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -41,7 +41,7 @@ public class Main {
|
|||
* A version identifier that should be updated every time the extractor changes in such a way that
|
||||
* it may produce different tuples for the same file under the same {@link ExtractorConfig}.
|
||||
*/
|
||||
public static final String EXTRACTOR_VERSION = "2022-11-29";
|
||||
public static final String EXTRACTOR_VERSION = "2023-02-15";
|
||||
|
||||
public static final Pattern NEWLINE = Pattern.compile("\n");
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#10000=@"/rails.erb;sourcefile"
|
||||
files(#10000,"/rails.erb")
|
||||
#10000=@"/rails.html.erb;sourcefile"
|
||||
files(#10000,"/rails.html.erb")
|
||||
#10001=@"/;folder"
|
||||
folders(#10001,"/")
|
||||
containerparent(#10001,#10000)
|
||||
|
|
Загрузка…
Ссылка в новой задаче