Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Added missing checkstyle config files #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions checkstyle_config/checkstyle_packages.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE checkstyle-packages PUBLIC
"-//Puppy Crawl//DTD Package Names 1.0//EN"
"http://www.puppycrawl.com/dtds/packages_1_0.dtd">

<checkstyle-packages>
<package name="jmemorize.checks"/>
</checkstyle-packages>
17 changes: 17 additions & 0 deletions checkstyle_config/gpl-header-check.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
^/\*
^ \* jMemorize - Learning made easy \(and fun\) - A Leitner flashcards tool
^ \* Copyright\(C\).*
^ \*
^ \* This program is free software; you can redistribute it and/or modify
^ \* it under the terms of the GNU General Public License as published by
^ \* the Free Software Foundation; .*
^ \* .*any later version.
^ \*
^ \* This program is distributed in the hope that it will be useful,
^ \* but WITHOUT ANY WARRANTY; without even the implied warranty of
^ \* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\. See the
^ \* GNU General Public License for more details.
^ \*
^ \* You should have received a copy of the GNU General Public License
^ \* along with this program; if not, write to the Free Software
^ \* Foundation, Inc\., .*
57 changes: 57 additions & 0 deletions checkstyle_config/jmemorize-checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This configuration file was written by the eclipse-cs plugin configuration editor
-->
<!--
Checkstyle-Configuration: jmemorize-checkstyle.xml
Description:
Checkstyle configuration for jmemorize
-->
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker">
<property name="severity" value="warning"/>
<module name="TreeWalker">
<module name="DefaultComesLast"/>
<module name="DoubleCheckedLocking"/>
<module name="EqualsHashCode">
<property name="severity" value="error"/>
</module>
<module name="FallThrough"/>
<module name="IllegalCatch">
<property name="severity" value="ignore"/>
</module>
<module name="MissingSwitchDefault">
<property name="severity" value="ignore"/>
</module>
<module name="ModifiedControlVariable"/>
<module name="ArrayTrailingComma">
<property name="severity" value="ignore"/>
</module>
<module name="TabCharacter">
<metadata name="com.atlassw.tools.eclipse.checkstyle.lastEnabledSeverity" value="error"/>
<property name="severity" value="error"/>
</module>
<module name="LeftCurly">
<property name="severity" value="warning"/>
<property name="option" value="nl"/>
<property name="tokens" value="CLASS_DEF,CTOR_DEF,INTERFACE_DEF,LITERAL_CATCH,LITERAL_DO,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_SWITCH,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,METHOD_DEF"/>
</module>
<module name="RightCurly">
<property name="severity" value="warning"/>
<property name="option" value="alone"/>
</module>
<module name="RegexpHeader">
<property name="severity" value="ignore"/>
<property name="headerFile" value="gpl-header-check.txt"/>
</module>
<module name="UpperEll">
<property name="severity" value="ignore"/>
</module>
<module name="jmemorize.checks.ExceptionLoggedCheck">
<property name="severity" value="warning"/>
</module>
</module>
<module name="NewlineAtEndOfFile">
<property name="severity" value="ignore"/>
</module>
</module>
19 changes: 16 additions & 3 deletions src/jmemorize/core/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -545,9 +545,22 @@ private void fireLessonModified(Lesson lesson)
/**
* @param args the command line arguments
*/
public static void main(String args[])
public static void main(String args[])
{
File file = args.length >= 1 ? new File(args[0]) : null;
Main.getInstance().run(file);
File file = null;
if (args.length >= 1)
{
file = new File(args[0]);
}
else if (Main.getInstance().getRecentLessonFiles().size() >= 1)
{
String filename = Main.getInstance().getRecentLessonFiles().get(0);
file = new File(filename);
if (!file.exists())
{
file = null;
}
}
Main.getInstance().run(file);
}
}