
#Jgrasp change tab size code#
Your code must pass Checkstyle without any warnings AND meet all the requirements outlined below. Submission: At the end of class today, or by 11:00 PM tomorrow if you would like more time, submit a corrected version of Payroll.java via Autolab. (If you logged in as student today, please log out and log back in with your own account.)ĭownload: Payroll.java or Create a new folder in your stu server called lab03 and copy the code from the stu server /cs/shr/code/Payroll.java into your new folder. Then create a lab03 folder for today's lab. If you haven't already, you should create a top-level CS149 folder to organize all your labs and other assignments for the semester. Select the Soft Tabs checkbox then set tab size to 4. In the JGrasp menu select: Settings->CSD Window settings -> Workspace. Clicking the second button will run Checkstyle on all of the Java files in the current directory.Īlso, You may want to setup JGrasp to indent properly and handle tabs well. Clicking the first button will run Checkstyle on the current file in the editor window. If all went well, you should see two new buttons on the jGRASP toolbar: and. TIP: You can use the HOME button when hitting the Browse button on the checkstyle dialog to go to your users home folder in Linux as shown below

jar file(probably /usr/home/stu/stu-f/eid/cs149/lab03), and "Checks File" to be the cs149wc.xml file, then click "OK". In the "Checkstyle Tool Settings" dialog box set "Checkstyle Home" toīe the folder containing the. xml configuration file, open jGRASP and select: Tools -> Checkstyle -> Configure. Part 1 Running Checkstyle Through JGraspĪfter you have downloaded the Checkstyle. Note however that Checkstyle does NOT evaluate the quality of comments, meaning of variable names, and placement of declarations. If you apply Checkstyle to your source code regularly, you will likely internalize good style habits over time. This example refers to a method beginning on line 93, column 5 of Welcome.java: Welcome.java:93:5: Missing a Javadoc comment The output indicates the file and line number of each problem. Note the * characters are wildcards that match whatever version of Checkstyle you have and whatever java source files are present.

Open a terminal and use the following command to run Checkstyle: java -jar checkstyle-*-all.jar -c cs149.xml *.java java file(for example Hello or Welcome.java from the last lab, or the Payroll.java in the next section below are all in the same directory).Ĭheck your Checkstyle setup: CS149Style.java should pass with no errors if you have config setup properly. It also checks for common programming mistakes, such as empty statements and shadow variables.Ĭ Running Checkstyle from command lineĭownload these two files into the same directory as your code:Ĭ - command line toolĬs149.xml - configuration file for CS 149 Rather than memorize a long list of rules, you should develop good habits and intuition when it comes to style.Ĭheckstyle is a tool that can be used to determine if your source code follows a set of style rules. This course will more or less follow a simplified version of these guidelines. Here are two examples of "industrial strength" Java style guides:
#Jgrasp change tab size how to#
Virtually every organization that does software development has strict guidelines on how to format source code.
