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

Add codespell support (config, workflow to detect/not fix) and make it fix few typos #77

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
6 changes: 6 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = .git*,.codespellrc,*.csv
check-hidden = true
# ignore-regex =
ignore-words-list = ans,nd,assignin,onl
25 changes: 25 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Codespell configuration is within .codespellrc
---
name: Codespell

on:
push:
branches: [master]
pull_request:
branches: [master]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Annotate locations with typos
uses: codespell-project/codespell-problem-matcher@v1
- name: Codespell
uses: codespell-project/actions-codespell@v2
2 changes: 1 addition & 1 deletion Browsing Functions/allen_ccf_npx_4shank.m
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ function update_slice(probe_atlas_gui,varargin)

end

% Get the coordiates on the plane
% Get the coordinates on the plane
x_idx = round(plane_x);
y_idx = round(plane_y);
z_idx = round(plane_z);
Expand Down
2 changes: 1 addition & 1 deletion Browsing Functions/allen_ccf_npx_4shank_spherical.m
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ function update_slice(probe_atlas_gui,varargin)

end

% Get the coordiates on the plane
% Get the coordinates on the plane
x_idx = round(plane_x);
y_idx = round(plane_y);
z_idx = round(plane_z);
Expand Down
2 changes: 1 addition & 1 deletion Browsing Functions/distinguishable_colors.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
bg = [1 1 1]; % default white background
else
if iscell(bg)
% User specified a list of colors as a cell aray
% User specified a list of colors as a cell array
bgc = bg;
for i = 1:length(bgc)
bgc{i} = parsecolor(bgc{i});
Expand Down
2 changes: 1 addition & 1 deletion Browsing Functions/plotAsProbe.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


function plotAsProbe(data, ann_percents, yc, cm, cm2, sqSizeY, active_site_start, rpl)
% data is vector, same lenght as xc and yc
% data is vector, same length as xc and yc
% cm is colormap, size [n x 3]
%
% other usage: if data is empty and cm's first dimension is the same length
Expand Down
2 changes: 1 addition & 1 deletion Browsing Functions/plotDistToNearestToTip.m
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
cur_annotation_square = squeeze(annotation_square(ind,:,:));
currSqVec = cur_annotation_square(:);

% find where the annotation isn't equal to that at the curent point
% find where the annotation isn't equal to that at the current point
otherInd = find(currSqVec(distOrder)~=currSqVec(distOrder(1)),1);
if isempty(otherInd)
otherDist(ind) = dists(end);
Expand Down
2 changes: 1 addition & 1 deletion Browsing Functions/selectStructure.m
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ function doSelectAll(selectall_btn, evd, listbox) %#ok

%% Listbox callback
function doListboxClick(listbox, evd, selectall_btn) %#ok
% if this is a doubleclick, doOK
% if this is a double-click, doOK
if strcmp(get(gcbf,'SelectionType'),'open')
doOK([],[],listbox);
elseif nargin == 3
Expand Down
2 changes: 1 addition & 1 deletion SHARP-Track/Analyze_ROIs.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@


% initialize array of locations (AP, DV, ML relative to bregma) in reference space
% and the correponding region annotations
% and the corresponding region annotations
roi_location = zeros(sum(rois(:)>0),3);
roi_annotation = cell(sum(rois(:)>0),3);

Expand Down
2 changes: 1 addition & 1 deletion SHARP-Track/Process_Histology.m
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
% it also pads images smaller than the reference_size and requests that you
% crop images larger than this size
%
% note -- presssing left or right arrow saves the modified image, so be
% note -- pressing left or right arrow saves the modified image, so be
% sure to do this even after modifying the last slice in the folder
slice_figure = figure('Name','Slice Viewer');
SliceFlipper(slice_figure, folder_processed_images, atlas_reference_size)
Expand Down