-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #944 from HL7/2024-08-gg-jekyll-performance
2024 08 gg jekyll performance
- Loading branch information
Showing
7 changed files
with
97 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
....publisher.core/src/main/java/org/hl7/fhir/igtools/renderers/utils/LineLengthChecker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.hl7.fhir.igtools.renderers.utils; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
|
||
import org.hl7.fhir.utilities.TextFile; | ||
|
||
public class LineLengthChecker { | ||
|
||
public static void main(String[] args) throws IOException { | ||
new LineLengthChecker().check(args[0], 8192); | ||
} | ||
|
||
private int total; | ||
|
||
private void check(String path, int limit) throws IOException { | ||
System.out.println("Checking line lengths in "+path); | ||
check(new File(path), limit); | ||
System.out.println("Finished - checked "+total+" files"); | ||
} | ||
|
||
private void check(File file, int limit) throws IOException { | ||
for (File f : file.listFiles()) { | ||
if (f.isDirectory()) { | ||
check(f, limit); | ||
} else if (f.length() > 0) { | ||
total++; | ||
int length = 0; | ||
String source = TextFile.fileToString(f); | ||
for (String line : source.split("\\R")) { | ||
int l = line.length(); | ||
if (l > length) { | ||
length = l; | ||
} | ||
} | ||
if (length > limit) { | ||
|
||
System.out.println("File "+f.getAbsolutePath()+": longest line = "+length); | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters