Skip to content

Commit

Permalink
Gitignore for IntelliJ and some small cleanups (#175)
Browse files Browse the repository at this point in the history
* gitignore: IntelliJ

* simplify some code

* gitignore: generated out

* simplify code

* cleanup unused code
  • Loading branch information
albertz authored Jun 1, 2021
1 parent a6f3b10 commit f3ed2f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 25 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
/lib/
/deps/
/tests/
/out/

# Top-level jar, but not jars in subfolders (if any)
*.jar
Expand Down Expand Up @@ -51,6 +52,10 @@ jacoco.exec
# vscode-specific
/.vscode/

# IntelliJ specific
/.idea
*.iml

# External tool builders
**/.externalToolBuilders/

Expand Down
31 changes: 6 additions & 25 deletions Source/Core/src/ca/uqac/lif/textidote/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,16 +217,8 @@ public static int mainLoop(String[] args, InputStream in, PrintStream out, Print
{
app_name = map.getOptionValue("name");
}
boolean read_all = false;
if (map.hasOption("read-all"))
{
read_all = true;
}
boolean enable_colors = true;
if (map.hasOption("no-color"))
{
enable_colors = false;
}
boolean read_all = map.hasOption("read-all");
boolean enable_colors = !map.hasOption("no-color");
AnsiPrinter stdout = new AnsiPrinter(out);
AnsiPrinter stderr = null;
if (map.hasOption("version"))
Expand All @@ -248,30 +240,21 @@ public static int mainLoop(String[] args, InputStream in, PrintStream out, Print
if (map.hasOption("ignore"))
{
String[] ids = map.getOptionValue("ignore").split(",");
for (String id : ids)
{
rule_blacklist.add(id);
}
Collections.addAll(rule_blacklist, ids);
}
// User has specified environments to remove
List<String> env_blacklist = new ArrayList<String>();
if (map.hasOption("remove"))
{
String[] ids = map.getOptionValue("remove").split(",");
for (String id : ids)
{
env_blacklist.add(id);
}
Collections.addAll(env_blacklist, ids);
}
// User has specified environments to remove
List<String> mac_blacklist = new ArrayList<String>();
if (map.hasOption("remove-macros"))
{
String[] ids = map.getOptionValue("remove-macros").split(",");
for (String id : ids)
{
mac_blacklist.add(id);
}
Collections.addAll(mac_blacklist, ids);
}
// User uses n-gram
String ngram_dir = "";
Expand Down Expand Up @@ -556,9 +539,8 @@ else if (output_method.compareToIgnoreCase("json") == 0)
filenames.add("--"); // This indicates: read from stdin
cmd_filenames.add("--");
}
Queue<String> filename_queue = new ArrayDeque<String>();
Set<String> processed_filenames = new HashSet<String>();
filename_queue.addAll(filenames);
Queue<String> filename_queue = new ArrayDeque<String>(filenames);
String top_level_filename = null;
while (!filename_queue.isEmpty())
{
Expand Down Expand Up @@ -610,7 +592,6 @@ else if (output_method.compareToIgnoreCase("json") == 0)
if (input_type == Linter.Language.MARKDOWN || filename.endsWith(".md"))
{
MarkdownCleaner markdown_cleaner = new MarkdownCleaner();
linter = new Linter(c_cleaner);
c_cleaner.add(markdown_cleaner);
linter = new Linter(c_cleaner);
populateMarkdownRules(linter);
Expand Down

0 comments on commit f3ed2f1

Please sign in to comment.