diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 000000000..9b0b920cb --- /dev/null +++ b/.codespellrc @@ -0,0 +1,6 @@ +[codespell] +skip = .git,*.pdf,*.svg,*.csv,*.odb +# testng - module name +# ans - variable name used +# ue - used for instance of UndoableEdit +ignore-words-list = testng,ans,ue diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 000000000..5768d7c63 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,19 @@ +--- +name: Codespell + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Codespell + uses: codespell-project/actions-codespell@v1 diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 583f1b0a8..98bbc5ff9 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -309,7 +309,7 @@ and '&' with 'and' # Announcements ## 1/20/2015 -* Yosemite no longer supports Java QuickTime and so Datavyu is not curently compatible. We apologize for the inconvenience and advise our users to be aware of the situation before deciding to upgrade to Yosemite. +* Yosemite no longer supports Java QuickTime and so Datavyu is not currently compatible. We apologize for the inconvenience and advise our users to be aware of the situation before deciding to upgrade to Yosemite. * If you try to download Datavyu and receive a pop up saying: "Datavyu is damaged and should be moved to the trash," please check your security settings to allow the download of the software. Please go to System Preferences/Security/General tab and then check "Allow apps to be downloaded from: anywhere." diff --git a/src/main/favorites/export_data_by_frame-multifile.rb b/src/main/favorites/export_data_by_frame-multifile.rb index bab64a079..fdc04f93b 100644 --- a/src/main/favorites/export_data_by_frame-multifile.rb +++ b/src/main/favorites/export_data_by_frame-multifile.rb @@ -39,7 +39,7 @@ def printCellArgs(cell) output_filename = "~/Desktop/framebyframe_export.csv" # ============================================================================= - # END OF USER CHANGABLE OPTIONS + # END OF USER CHANGEABLE OPTIONS # ============================================================================= filedir = File.expand_path(filedir) files = Dir.new(filedir) @@ -81,7 +81,7 @@ def printCellArgs(cell) end # Get min and max times - puts "Getting the minimum and maximium times for the files..." + puts "Getting the minimum and maximum times for the files..." min = 99999999999999 max = 0 for col in columns diff --git a/src/main/favorites/export_data_by_frame.rb b/src/main/favorites/export_data_by_frame.rb index 9b70d7731..9c46a3b9c 100644 --- a/src/main/favorites/export_data_by_frame.rb +++ b/src/main/favorites/export_data_by_frame.rb @@ -25,7 +25,7 @@ end # Get min and max times - puts "Getting the minimum and maximium times for the files..." + puts "Getting the minimum and maximum times for the files..." min = 99999999999999 max = 0 for col in columns @@ -68,10 +68,10 @@ end puts "Completed building data. Writing to file " + output_filename - fo = File.new(File.expand_path(output_filename), 'a') - fo.write(output) - fo.flush() - fo.close() + output_file = File.new(File.expand_path(output_filename), 'a') + output_file.write(output) + output_file.flush() + output_file.close() puts "Finished." diff --git a/src/main/favorites/typechanger.rb b/src/main/favorites/typechanger.rb index efced8e6f..c384ab40b 100644 --- a/src/main/favorites/typechanger.rb +++ b/src/main/favorites/typechanger.rb @@ -23,6 +23,6 @@ count += 1 end end - puts "\nNumber of columns changed: " + count.to_s + puts "\number of columns changed: " + count.to_s puts "\nFile is NOT saved. It is recommended that you do so as soon as you verify that you are content with the changes." end diff --git a/src/main/java/org/datavyu/controllers/CreateNewCellController.java b/src/main/java/org/datavyu/controllers/CreateNewCellController.java index 199fab39a..7a9f40c9e 100644 --- a/src/main/java/org/datavyu/controllers/CreateNewCellController.java +++ b/src/main/java/org/datavyu/controllers/CreateNewCellController.java @@ -278,12 +278,12 @@ public void createNewCell(final long milliseconds) { * Situation 3: User has set focus on a particular cell in the * spreadsheet - the caret is or has been in one of the editable parts * of a spreadsheet cell. First check this request has not come from the - * video controller. For the focussed cell do Create a new cell with the - * focussed cell onset and offset and insert into the db. + * video controller. For the focused cell do Create a new cell with the + * focused cell onset and offset and insert into the db. * * Situation 4: Request has come from the video controller and there is * no currently selected column. Create a new cell in the same column as - * the last created cell or the last focussed cell. + * the last created cell or the last focused cell. */ long onset = milliseconds; diff --git a/src/main/java/org/datavyu/controllers/OpenDataStoreFileController.java b/src/main/java/org/datavyu/controllers/OpenDataStoreFileController.java index e4800943b..218c21ad9 100644 --- a/src/main/java/org/datavyu/controllers/OpenDataStoreFileController.java +++ b/src/main/java/org/datavyu/controllers/OpenDataStoreFileController.java @@ -124,7 +124,7 @@ protected DataStore openAsCsv(final InputStream inputStream) { line = parseVariable(csvFile, line, db, "#4"); } if (!db.getExemptionVariables().isEmpty()) { - logger.info("We have excemption variables"); + logger.info("We have exemption variables"); SwingUtilities.invokeLater(new NameWarning(db.getExemptionVariables())); } } else if ("#3".equalsIgnoreCase(line)) { diff --git a/src/main/java/org/datavyu/models/component/TimescaleModel.java b/src/main/java/org/datavyu/models/component/TimescaleModel.java index 8aa3945ea..5f7353c51 100644 --- a/src/main/java/org/datavyu/models/component/TimescaleModel.java +++ b/src/main/java/org/datavyu/models/component/TimescaleModel.java @@ -107,7 +107,7 @@ public int getZoomWindowToTrackTransitionHeight() { } /** - * Set the height of the transition from teh zoom window to the track + * Set the height of the transition from the zoom window to the track */ public void setZoomWindowToTrackTransitionHeight( final int zoomWindowToTrackTransitionHeight) { diff --git a/src/main/java/org/datavyu/plugins/StreamViewer.java b/src/main/java/org/datavyu/plugins/StreamViewer.java index c2b1fc932..2f5179974 100644 --- a/src/main/java/org/datavyu/plugins/StreamViewer.java +++ b/src/main/java/org/datavyu/plugins/StreamViewer.java @@ -114,7 +114,7 @@ public interface StreamViewer { void pause(); /** - * Steps foward + * Steps forward */ void stepForward(); diff --git a/src/main/java/org/datavyu/undoableedits/CellTO.java b/src/main/java/org/datavyu/undoableedits/CellTO.java index 46c3891f7..62d43ecce 100755 --- a/src/main/java/org/datavyu/undoableedits/CellTO.java +++ b/src/main/java/org/datavyu/undoableedits/CellTO.java @@ -27,7 +27,7 @@ import org.datavyu.models.db.Variable; /** - * Cell Transfer Object for holding the changes that need to be transfered from + * Cell Transfer Object for holding the changes that need to be transferred from * undo / redo states to the datastore. */ public final class CellTO { diff --git a/src/main/java/org/datavyu/util/FileSystemTreeModel.java b/src/main/java/org/datavyu/util/FileSystemTreeModel.java index 876764c71..ca996182d 100644 --- a/src/main/java/org/datavyu/util/FileSystemTreeModel.java +++ b/src/main/java/org/datavyu/util/FileSystemTreeModel.java @@ -212,7 +212,7 @@ else if (file1.isFile() && file2.isDirectory()) /** - * Retur a string representation of this node. + * Return a string representation of this node. * The inherited toString() method returns the entire path. * For use in a tree structure, the name is more appropriate. * diff --git a/src/main/java/org/datavyu/util/WindowsOS.java b/src/main/java/org/datavyu/util/WindowsOS.java index 9019d6958..e86ee09c9 100644 --- a/src/main/java/org/datavyu/util/WindowsOS.java +++ b/src/main/java/org/datavyu/util/WindowsOS.java @@ -131,7 +131,7 @@ public static void exec(final String cmd) { * * @param brokenChar The broken character code. * - * @return The remapped character code wich is: brokenChar + 64. + * @return The remapped character code which is: brokenChar + 64. */ public static char remapKeyChar(final char brokenChar) { return (char) ( ((int)brokenChar) + 64); diff --git a/src/main/java/org/datavyu/views/DatavyuFileChooser.java b/src/main/java/org/datavyu/views/DatavyuFileChooser.java index 8c36fc39b..80ab4ed1c 100644 --- a/src/main/java/org/datavyu/views/DatavyuFileChooser.java +++ b/src/main/java/org/datavyu/views/DatavyuFileChooser.java @@ -22,7 +22,7 @@ /** - * A file chooser to use within Datavyu - overides the general JFileChooser. + * A file chooser to use within Datavyu - overrides the general JFileChooser. */ public final class DatavyuFileChooser extends JFileChooser { diff --git a/src/main/java/org/datavyu/views/DatavyuView.java b/src/main/java/org/datavyu/views/DatavyuView.java index 0f5085519..bcfd731f9 100755 --- a/src/main/java/org/datavyu/views/DatavyuView.java +++ b/src/main/java/org/datavyu/views/DatavyuView.java @@ -261,7 +261,7 @@ public boolean dispatchKeyEvent(final KeyEvent evt) { // Set the close accerator to keyMask + 'W'; closeTabMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_W, keyMask)); - //Use Datavyu.class key dispatcher to handel CMD+L and CML+R Hotkey + //Use Datavyu.class key dispatcher to handle CMD+L and CML+R Hotkey // Set the new accelerator to keyMask + 'L'; // newCellLeftMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_L, keyMask)); @@ -1778,7 +1778,7 @@ public void deleteColumn() { */ @Action public void hideColumn() { - logger.info("Hidding columns"); + logger.info("Hiding columns"); List selectedVariables = null; if(Datavyu.getPlatform() == Platform.WINDOWS && menuMouseEventFlag){ selectedVariables = Datavyu.getProjectController().getLastSelectedVariables(); diff --git a/src/main/java/org/datavyu/views/VariableListV.java b/src/main/java/org/datavyu/views/VariableListV.java index 1e48face2..08fc883b8 100644 --- a/src/main/java/org/datavyu/views/VariableListV.java +++ b/src/main/java/org/datavyu/views/VariableListV.java @@ -205,7 +205,7 @@ public void tableChanged(TableModelEvent e) { Variable var = dbToTableMap.inverse().get(row); if (columnName.equals(rMap.getString("Table.visibleColumn"))) { - LOGGER.info("Editied Variable Visbility from VariableList"); + LOGGER.info("Editied Variable Visibility from VariableList"); if (var.isHidden() == (Boolean) data) { var.setHidden(!(Boolean) data); diff --git a/src/main/java/org/datavyu/views/VideoController.java b/src/main/java/org/datavyu/views/VideoController.java index f760c83d8..1056ed297 100644 --- a/src/main/java/org/datavyu/views/VideoController.java +++ b/src/main/java/org/datavyu/views/VideoController.java @@ -1219,7 +1219,7 @@ private void handleNeedleChange(final NeedleState needle) { private void handleRegionChange(final RegionState region) { final long start = region.getRegionStart(); final long end = region.getRegionEnd(); - logger.info("Set Region with start " + start + " ane end " + end + " CLock " + clockTimer.getClockTime()); + logger.info("Set Region with start " + start + " and end " + end + " CLock " + clockTimer.getClockTime()); clockTimer.setMinTime(start); clockTimer.setMaxTime(end); } diff --git a/src/main/java/org/datavyu/views/discrete/ColumnVisibilityListener.java b/src/main/java/org/datavyu/views/discrete/ColumnVisibilityListener.java index 629b74908..6a521418f 100755 --- a/src/main/java/org/datavyu/views/discrete/ColumnVisibilityListener.java +++ b/src/main/java/org/datavyu/views/discrete/ColumnVisibilityListener.java @@ -15,7 +15,7 @@ package org.datavyu.views.discrete; /** - * A listener for listening to column visiblity changes + * A listener for listening to column visibility changes */ public interface ColumnVisibilityListener { diff --git a/src/main/java/org/datavyu/views/discrete/EditorComponent.java b/src/main/java/org/datavyu/views/discrete/EditorComponent.java index d3a48ce2a..3f1c000b1 100644 --- a/src/main/java/org/datavyu/views/discrete/EditorComponent.java +++ b/src/main/java/org/datavyu/views/discrete/EditorComponent.java @@ -468,7 +468,7 @@ && getCaretPosition() < getText().length()) { * method will simply shift the caret back one spot. */ public final void removeBehindCaret() { - // Underlying text field has selection and no carret, simply remove + // Underlying text field has selection and no caret, simply remove // everything that is selected. if ((getSelectionEnd() - getSelectionStart()) > 0) { removeSelectedText(); diff --git a/src/main/java/org/datavyu/views/discrete/SpreadSheetPanel.java b/src/main/java/org/datavyu/views/discrete/SpreadSheetPanel.java index b2feca5f6..b0dab7f1f 100755 --- a/src/main/java/org/datavyu/views/discrete/SpreadSheetPanel.java +++ b/src/main/java/org/datavyu/views/discrete/SpreadSheetPanel.java @@ -593,7 +593,7 @@ private void highlightAdjacentCell(final int direction) { if ((newColID >= 0) && (newColID < columns.size())) { - // Find the most appopriate cell in the new + // Find the most appropriate cell in the new // column. int newCellID = Math.min(cellID, (columns.get(newColID).getCells().size() - 1)); diff --git a/src/main/java/org/datavyu/views/discrete/SpreadsheetCell.java b/src/main/java/org/datavyu/views/discrete/SpreadsheetCell.java index 817dcef6a..20cbfcb30 100755 --- a/src/main/java/org/datavyu/views/discrete/SpreadsheetCell.java +++ b/src/main/java/org/datavyu/views/discrete/SpreadsheetCell.java @@ -223,7 +223,7 @@ public SpreadsheetCell(final SpreadsheetColumn parentColumn, cellPanel.setBorder(NORMAL_BORDER); cellPanel.setLayout(new BorderLayout()); - // Set the apperance of the top panel and add child elements (ord, onset + // Set the appearance of the top panel and add child elements (ord, onset // and offset). topPanel.setOpaque(false); topPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 2, 0)); @@ -243,7 +243,7 @@ public SpreadsheetCell(final SpreadsheetColumn parentColumn, topPanel.add(strut2); topPanel.add(offset); - // Set the apperance of the data panel - add elements for dis6playing + // Set the appearance of the data panel - add elements for dis6playing // the actual data of the panel. cellPanel.add(dataPanel, BorderLayout.CENTER); diff --git a/src/main/java/org/datavyu/views/discrete/SpreadsheetEmptyCell.java b/src/main/java/org/datavyu/views/discrete/SpreadsheetEmptyCell.java index e60e4d769..ad60dd128 100644 --- a/src/main/java/org/datavyu/views/discrete/SpreadsheetEmptyCell.java +++ b/src/main/java/org/datavyu/views/discrete/SpreadsheetEmptyCell.java @@ -161,7 +161,7 @@ public SpreadsheetEmptyCell(final Variable newCol) { cellPanel.setBorder(NORMAL_BORDER); cellPanel.setLayout(new BorderLayout()); - // Set the apperance of the top panel and add child elements (ord, onset + // Set the appearance of the top panel and add child elements (ord, onset // and offset). topPanel.setOpaque(false); topPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 2, 0)); @@ -181,7 +181,7 @@ public SpreadsheetEmptyCell(final Variable newCol) { topPanel.add(strut2); topPanel.add(offset); - // Set the apperance of the data panel - add elements for dis6playing + // Set the appearance of the data panel - add elements for dis6playing // the actual data of the panel. cellPanel.add(dataPanel, BorderLayout.CENTER); diff --git a/src/main/java/org/datavyu/views/discrete/datavalues/FixedText.java b/src/main/java/org/datavyu/views/discrete/datavalues/FixedText.java index 9f3cf2aaf..fc4ccdade 100644 --- a/src/main/java/org/datavyu/views/discrete/datavalues/FixedText.java +++ b/src/main/java/org/datavyu/views/discrete/datavalues/FixedText.java @@ -33,7 +33,7 @@ public class FixedText extends EditorComponent { * * @param ta The Parent JTextComponent that this FixedText editor is nested * within. - * @param text The inital text to use for this Fixedtext component. + * @param text The initial text to use for this Fixedtext component. */ public FixedText(final JTextComponent ta, final String text) { super(ta, text); diff --git a/src/main/java/org/datavyu/views/discrete/datavalues/vocabelements/FormalArgEditor.java b/src/main/java/org/datavyu/views/discrete/datavalues/vocabelements/FormalArgEditor.java index 10d9ba717..73a47cd95 100644 --- a/src/main/java/org/datavyu/views/discrete/datavalues/vocabelements/FormalArgEditor.java +++ b/src/main/java/org/datavyu/views/discrete/datavalues/vocabelements/FormalArgEditor.java @@ -53,7 +53,7 @@ public final class FormalArgEditor extends EditorComponent { private boolean defaultVal; /** - * @param ta The JTextComponent that this virtual editor floats ontop. + * @param ta The JTextComponent that this virtual editor floats on top. * @param var The parent that this argument belongs too. * @param index The index of the argument within the parent vocabelement * that this Editor will represent. diff --git a/src/main/resources/Datavyu_API.rb b/src/main/resources/Datavyu_API.rb index 802928679..c542c5529 100644 --- a/src/main/resources/Datavyu_API.rb +++ b/src/main/resources/Datavyu_API.rb @@ -209,7 +209,7 @@ def change_code(arg, val) alias :change_arg :change_code # Print ordinal, onset, offset, and values of all codes in the cell to console. - # @param sep [String] seperator used between the arguments + # @param sep [String] separator used between the arguments # @return [nil] # @example Print the first cell in the 'trial' column # trial = get_column("trial") @@ -565,7 +565,7 @@ def []=(row, column, value) # !@attr table # @return [Matrix] contingency table of values # !@attr codes -# @return [Array] list of code valus; indices serve as keys for table +# @return [Array] list of code values; indices serve as keys for table class CTable attr_accessor :table, :codes @@ -652,7 +652,7 @@ def to_s # @param rel_col [RColumn, String] reliability coder's column # @param codes [Array] codes to compute scores for # @return [Hash] mapping from code names to kappa values -# @return [Hash] mapping fromm code names to contingency tables +# @return [Hash] mapping from code names to contingency tables # @example # primary_column_name = 'trial' # reliability_column_name = 'trial_rel' @@ -928,7 +928,7 @@ def set_column(*args, sanitize_codes: true) # Deletes a variable from the spreadsheet and rebuilds it from # the given RColumn object. # Behaves similar to setVariable(), but this will ALWAYS delete -# and rebuild the spreadsheet colum and its vocab. +# and rebuild the spreadsheet column and its vocab. def set_column!(*args, sanitize_codes: true) if args.length == 1 var = args[0] @@ -2033,10 +2033,10 @@ def load_macshapa_db2(filename, write_to_gui, *ignore_vars) # Transfers columns between databases. # If db1 or db2 are set to the empty string "", then that database is the current database in $db (usually the GUI's database). # So if you want to transfer a column into the GUI, set db2 to "". -# If you want to tranfer a column from the GUI into a file, set db1 to "". +# If you want to transfer a column from the GUI into a file, set db1 to "". # Setting remove to true will DELETE THE COLUMNS YOU ARE TRANSFERRING FROM DB1. Be careful! # @param db1 [String] The FULL PATH toa Datavyu file or "" to use the currently opened database. Columns are transferred FROM here. -# @param db2 [String]: The FULL PATH to the saved Datavyu file or "" to use the currently opened database. Columns are tranferred TO here. +# @param db2 [String]: The FULL PATH to the saved Datavyu file or "" to use the currently opened database. Columns are transferred TO here. # @param remove [true, false] Set to true to delete columns in DB1 as they are moved to db2. Set to false to leave them intact. # @param varnames [Array] column names (requires at least 1): You can specify as many column names as you like that will be retrieved from db1. # @return nil @@ -2215,7 +2215,7 @@ def check_reliability(main_col, rel_col, match_arg, time_tolerance, *dump_file) printing = true end - # Define interal function for printing errors + # Define internal function for printing errors def print_err(m_cell, r_cell, arg, dump_file, main_col, rel_col) main_val = eval "m_cell.#{arg}" rel_val = eval "r_cell.#{arg}" @@ -2658,7 +2658,7 @@ def get_os alias :getOS :get_os # Return Datavyu version string. -# @return [String] Version string in the fromat "v.:#.#" +# @return [String] Version string in the format "v.:#.#" def get_datavyu_version return org.datavyu.util.DatavyuVersion.getLocalVersion.getVersion end diff --git a/src/main/resources/org/datavyu/resources/Build_Template.properties b/src/main/resources/org/datavyu/resources/Build_Template.properties index ecf1b4579..d1b8587b3 100644 --- a/src/main/resources/org/datavyu/resources/Build_Template.properties +++ b/src/main/resources/org/datavyu/resources/Build_Template.properties @@ -1,3 +1,3 @@ -# This is a template file that should never need chaning - the ${buildNumber} +# This is a template file that should never need chaining - the ${buildNumber} # gets automatically populated by maven. And injected into our about dialog. Application.build = b:${buildNumber} diff --git a/src/test/java/org/datavyu/util/UIImageUtils.java b/src/test/java/org/datavyu/util/UIImageUtils.java index 65e7a7d06..cd832292c 100644 --- a/src/test/java/org/datavyu/util/UIImageUtils.java +++ b/src/test/java/org/datavyu/util/UIImageUtils.java @@ -182,7 +182,7 @@ public static void captureAsScreenshot(final Frame frame, final File saveAs) { } catch (AWTException e) { logger.error("Screen capture failed. Error: ", e); } catch (IOException e) { - logger.error("Screen catpure failed due to IO. Error: ", e); + logger.error("Screen capture failed due to IO. Error: ", e); } } @@ -271,7 +271,7 @@ public static Rectangle getInternalRectangle(final Dialog dialog) { } /** - * Captures screenshot of component nd returns as BufferedImage. + * Captures screenshot of component and returns as BufferedImage. * * @param component JComponent to capture screenshot * @return BufferedImage screenshot of component @@ -292,7 +292,7 @@ public static BufferedImage captureAsScreenshot(final Component component) { } /** - * Captures screenshot of component nd returns as BufferedImage. + * Captures screenshot of component and returns as BufferedImage. * * @param frame JComponent to capture screenshot * @return BufferedImage screenshot of component