Skip to content

Commit 45abda7

Browse files
chore: pin eclipse formatter version and apply formatting
1 parent 68bed95 commit 45abda7

3 files changed

Lines changed: 57 additions & 49 deletions

File tree

pom.xml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,23 @@
3939
<groupId>com.diffplug.spotless</groupId>
4040
<artifactId>spotless-maven-plugin</artifactId>
4141
<version>${spotless.maven.plugin.version}</version>
42+
4243
<configuration>
4344
<java>
44-
<eclipse>
45-
<file>${project.basedir}/eclipse-formatter.xml</file>
46-
</eclipse>
47-
<trimTrailingWhitespace />
48-
<endWithNewline />
45+
<includes>
46+
<include>src/main/java/**/*.java</include>
47+
</includes>
48+
49+
<eclipse>
50+
<version>4.26</version>
51+
<file>${project.basedir}/eclipse-formatter.xml</file>
52+
</eclipse>
53+
54+
<trimTrailingWhitespace/>
55+
<endWithNewline/>
4956
</java>
5057
</configuration>
58+
5159
<executions>
5260
<execution>
5361
<id>spotless-check</id>

src/main/java/Creative Project 1 Todo/TodoListManager.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static void main(String[] args) throws FileNotFoundException {
4747
* Prints the `todos` List to standard out indexed by numbers, starting at 1.
4848
*
4949
* @param todos:
50-
* ArrayList of todo items of type String
50+
* ArrayList of todo items of type String
5151
*/
5252
public static void printTodos(List<String> todos) {
5353
System.out.println("Today's TODOs:");
@@ -65,9 +65,9 @@ public static void printTodos(List<String> todos) {
6565
* list on 'enter' Otherwise specify an index to add an item
6666
*
6767
* @param console:
68-
* Scanner object to parse user input
68+
* Scanner object to parse user input
6969
* @param todos:
70-
* ArrayList of todo items of type String
70+
* ArrayList of todo items of type String
7171
*/
7272
public static void addItem(Scanner console, List<String> todos) {
7373
System.out.print("What would you like to add? ");
@@ -101,9 +101,9 @@ public static void addItem(Scanner console, List<String> todos) {
101101
* remove a range of items from `todos`.
102102
*
103103
* @param console:
104-
* Scanner object to parse user input
104+
* Scanner object to parse user input
105105
* @param todos:
106-
* ArrayList of todo items of type String
106+
* ArrayList of todo items of type String
107107
*/
108108
public static void markItemAsDone(Scanner console, List<String> todos) {
109109
if (todos.isEmpty()) {
@@ -134,11 +134,11 @@ public static void markItemAsDone(Scanner console, List<String> todos) {
134134
* old todo's in the todos List on load.
135135
*
136136
* @param console:
137-
* Scanner object to parse user input
137+
* Scanner object to parse user input
138138
* @param todos:
139-
* ArrayList of todo items of type String
139+
* ArrayList of todo items of type String
140140
* @throws FileNotFoundException
141-
* when the user inputted file is not found
141+
* when the user inputted file is not found
142142
*/
143143
public static void loadItems(Scanner console, List<String> todos) throws FileNotFoundException {
144144
System.out.print("File name? ");
@@ -158,11 +158,11 @@ public static void loadItems(Scanner console, List<String> todos) throws FileNot
158158
* @brief Prints `todos` items to a user specified file
159159
*
160160
* @param console:
161-
* Scanner object to parse user input
161+
* Scanner object to parse user input
162162
* @param todos:
163-
* ArrayList of todo items of type String
163+
* ArrayList of todo items of type String
164164
* @throws FileNotFoundException
165-
* when the user inputted file is not found
165+
* when the user inputted file is not found
166166
*/
167167
public static void saveItems(Scanner console, List<String> todos) throws FileNotFoundException {
168168
System.out.print("File name? ");

src/main/java/Programming Assignment 0 Stonks/Stonks.java

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static void main(String[] args) throws FileNotFoundException {
6262
* symbols and 0.0 shares.
6363
*
6464
* @param stocks
65-
* the available stock tickers, e.g. AAPL
65+
* the available stock tickers, e.g. AAPL
6666
* @return the standard portfolio setup
6767
*/
6868
public static double[] setupPortfolio(String[] stocks) {
@@ -80,13 +80,13 @@ public static double[] setupPortfolio(String[] stocks) {
8080
* Calculates the amount of shares from the budget / price.
8181
*
8282
* @param stocks
83-
* the available stock tickers, e.g. AAPL
83+
* the available stock tickers, e.g. AAPL
8484
* @param prices
85-
* the buying price of one of all the given stocks
85+
* the buying price of one of all the given stocks
8686
* @param portfolio
87-
* the amount of stock owned by the owner of the portfolio
87+
* the amount of stock owned by the owner of the portfolio
8888
* @param input
89-
* user input scanner
89+
* user input scanner
9090
* @return true if buying was successful and false if not
9191
*/
9292
private static boolean buyingSimulation(String[] stocks, double[] prices, double[] portfolio,
@@ -124,11 +124,11 @@ private static boolean buyingSimulation(String[] stocks, double[] prices, double
124124
* Sells the user provided amount of shares of a stock.
125125
*
126126
* @param stocks
127-
* the available stock tickers, e.g. AAPL
127+
* the available stock tickers, e.g. AAPL
128128
* @param portfolio
129-
* the amount of stock owned by the owner of the portfolio
129+
* the amount of stock owned by the owner of the portfolio
130130
* @param input
131-
* user input scanner
131+
* user input scanner
132132
* @return true if selling was successful and false if not
133133
*/
134134
private static boolean sellingSimulation(String[] stocks, double[] portfolio, Scanner input) {
@@ -157,9 +157,9 @@ private static boolean sellingSimulation(String[] stocks, double[] portfolio, Sc
157157
* Displays the current state of the portfolio without showing 0.0 values.
158158
*
159159
* @param stocks
160-
* the available stock tickers, e.g. AAPL
160+
* the available stock tickers, e.g. AAPL
161161
* @param portfolio
162-
* the amount of stock owned by the owner of the portfolio
162+
* the amount of stock owned by the owner of the portfolio
163163
*/
164164
private static void displaySimulation(String[] stocks, double[] portfolio) {
165165
System.out.println();
@@ -175,13 +175,13 @@ private static void displaySimulation(String[] stocks, double[] portfolio) {
175175
* Saves the current state of the portfolio to a file specified by the user.
176176
*
177177
* @param stocks
178-
* the available stock tickers, e.g. AAPL
178+
* the available stock tickers, e.g. AAPL
179179
* @param portfolio
180-
* the amount of stock owned by the owner of the portfolio
180+
* the amount of stock owned by the owner of the portfolio
181181
* @param input
182-
* scanner object to read users file name
182+
* scanner object to read users file name
183183
* @throws FileNotFoundException
184-
* when user inputted file is not found
184+
* when user inputted file is not found
185185
*/
186186
private static void saveSimulation(String[] stocks, double[] portfolio, Scanner input)
187187
throws FileNotFoundException {
@@ -203,10 +203,10 @@ private static void saveSimulation(String[] stocks, double[] portfolio, Scanner
203203
* Loads the symbols from a TSV file.
204204
*
205205
* @param filename
206-
* the name of the file to fetch the stock symbols from
206+
* the name of the file to fetch the stock symbols from
207207
* @return an array of strings representing the stock symbols
208208
* @throws FileNotFoundException
209-
* when user inputted file is not found
209+
* when user inputted file is not found
210210
*/
211211
public static String[] getSymbolsFromFile(String filename) throws FileNotFoundException {
212212
Scanner fileScan = new Scanner(new File(filename));
@@ -232,10 +232,10 @@ public static String[] getSymbolsFromFile(String filename) throws FileNotFoundEx
232232
* Loads the prices from the TSV file.
233233
*
234234
* @param filename
235-
* the name of the file to fetch the stock symbols from
235+
* the name of the file to fetch the stock symbols from
236236
* @return an array of strings representing the stock prices
237237
* @throws FileNotFoundException
238-
* when user inputted file is not found
238+
* when user inputted file is not found
239239
*/
240240
public static double[] getPricesFromFile(String filename) throws FileNotFoundException {
241241
Scanner fileScan = new Scanner(new File(filename));
@@ -261,9 +261,9 @@ public static double[] getPricesFromFile(String filename) throws FileNotFoundExc
261261
* Finds the index of a symbol in the given symbols array.
262262
*
263263
* @param stocks
264-
* the available stock tickers, e.g. AAPL
264+
* the available stock tickers, e.g. AAPL
265265
* @param symbol
266-
* stock ticker, e.g. AAPL
266+
* stock ticker, e.g. AAPL
267267
* @return the index of the stock symbol in the stocks array
268268
*/
269269
public static int findSymbolIndex(String[] stocks, String symbol) {
@@ -279,13 +279,13 @@ public static int findSymbolIndex(String[] stocks, String symbol) {
279279
* Add shares to the portfolio.
280280
*
281281
* @param stocks
282-
* the available stock tickers, e.g. AAPL
282+
* the available stock tickers, e.g. AAPL
283283
* @param portfolio
284-
* the amount of stock owned by the owner of the portfolio
284+
* the amount of stock owned by the owner of the portfolio
285285
* @param symbol
286-
* stock ticker, e.g. AAPL
286+
* stock ticker, e.g. AAPL
287287
* @param shares
288-
* amount of the shares of stock bought
288+
* amount of the shares of stock bought
289289
* @return true if succeeded and false if not
290290
*/
291291
public static boolean addSharesToPortfolio(String[] stocks, double[] portfolio, String symbol,
@@ -303,13 +303,13 @@ public static boolean addSharesToPortfolio(String[] stocks, double[] portfolio,
303303
* Subtract shares from the portfolio.
304304
*
305305
* @param stocks
306-
* the available stock tickers, e.g. AAPL
306+
* the available stock tickers, e.g. AAPL
307307
* @param portfolio
308-
* the amount of stock owned by the owner of the portfolio
308+
* the amount of stock owned by the owner of the portfolio
309309
* @param symbol
310-
* stock ticker, e.g. AAPL
310+
* stock ticker, e.g. AAPL
311311
* @param sharesToSell
312-
* amount of shares of stock to be sold
312+
* amount of shares of stock to be sold
313313
* @return true if succeeded and false if not
314314
*/
315315
public static boolean subtractSharesFromPortfolio(String[] stocks, double[] portfolio,
@@ -333,9 +333,9 @@ public static boolean subtractSharesFromPortfolio(String[] stocks, double[] port
333333
* converting them to dollars and adding them up
334334
*
335335
* @param prices
336-
* the buying price of one of all the given stocks
336+
* the buying price of one of all the given stocks
337337
* @param portfolio
338-
* the amount of stock owned by the owner of the portfolio
338+
* the amount of stock owned by the owner of the portfolio
339339
* @return valuation of portfolio based on its owned shares
340340
*/
341341
public static double getPortfolioValuation(double[] prices, double[] portfolio) {
@@ -356,11 +356,11 @@ public static double getPortfolioValuation(double[] prices, double[] portfolio)
356356
* Gets the price of a stock from its symbol.
357357
*
358358
* @param stocks
359-
* the available stock tickers, e.g. AAPL
359+
* the available stock tickers, e.g. AAPL
360360
* @param prices
361-
* the buying price of one of all the given stocks
361+
* the buying price of one of all the given stocks
362362
* @param symbol
363-
* stock ticker, e.g. AAPL
363+
* stock ticker, e.g. AAPL
364364
* @return the price of stock given its symbol
365365
*/
366366
public static double getPrice(String[] stocks, double[] prices, String symbol) {

0 commit comments

Comments
 (0)