Skip to content

Commit

Permalink
ci: add spellchecker
Browse files Browse the repository at this point in the history
Problem: flux-accounting does not have a spellchecker that runs on pull
requests.

Add a spellchecker as another builder during CI.

Fix all of the spelling mistakes flagged by the spellchecker throughout
flux-accounting.

Add "dne" and "DNE" as acceptable words.
  • Loading branch information
cmoussa1 committed Oct 10, 2024
1 parent 8114844 commit 6d908f0
Show file tree
Hide file tree
Showing 19 changed files with 34 additions and 25 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ jobs:
- run: git fetch origin master
- uses: flux-framework/pr-validator@master

spelling:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Check Spelling
uses: crate-ci/typos@bcafd462cb07ef7ba57e34abf458fe20767e808b # v1.19.0

python-format:
name: python format
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion config/ax_flux_core.m4
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ AC_DEFUN([AX_FLUX_CORE], [
AC_SUBST(FLUX_PREFIX)
AC_SUBST(LIBFLUX_VERSION)
# Ensure we find the same flux executable as corresponds to
# to libflux-core found by pkg-config by puting FLUX_PREFIX/bin
# to libflux-core found by pkg-config by putting FLUX_PREFIX/bin
# first in AC_PATH_PROG's path
#
AC_PATH_PROG(FLUX,[flux],
Expand Down
2 changes: 1 addition & 1 deletion config/tap-driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ function setup_result_obj(line)
sub("^(not )?ok[ \t]*", "", line)
# If the result has an explicit number, get it and strip it; otherwise,
# automatically assing the next progresive number to it.
# automatically assign the next progresive number to it.
if (line ~ /^[0-9]+$/ || line ~ /^[0-9]+[^a-zA-Z0-9_]/)
{
match(line, "^[0-9]+")
Expand Down
2 changes: 2 additions & 0 deletions doc/test/spell.en.pws
Original file line number Diff line number Diff line change
Expand Up @@ -535,3 +535,5 @@ cancelall
raiseall
IPv4
IPv6
dne

Check warning on line 538 in doc/test/spell.en.pws

View workflow job for this annotation

GitHub Actions / spelling

"dne" should be "done".
DNE

Check warning on line 539 in doc/test/spell.en.pws

View workflow job for this annotation

GitHub Actions / spelling

"DNE" should be "DONE".
4 changes: 2 additions & 2 deletions doc/test/spellcheck
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

if test $man_base_dir; then
set ${man_base_dir}/man*/*.rst
set ${man_base_dir}/*.rst ${man_base_dir}/guide/*.rst ${man_base_dir}/man*/*.rst ${man_base_dir}/man*/common/*.rst
fi

if test $# == 0; then
Expand All @@ -22,7 +22,7 @@ if test -z "$ASPELL"; then
echo "1..0 # skip because aspell is not installed"
exit 0
fi
if ! $ASPELL -n list </dev/null >/dev/null; then
if ! $ASPELL -p $dict -n list </dev/null >/dev/null; then
echo "1..$# # skip because aspell dry run failed"
exit 0
fi
Expand Down
4 changes: 2 additions & 2 deletions src/bindings/python/fluxacct/accounting/bank_subcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def bank_is_active(cur, bank, parent_bank):
def check_if_bank_disabled(cur, bank, parent_bank):
"""
Check if the bank already exists but was disabled first. If so, just
update the 'active' column in the alread existing row.
update the 'active' column in the already existing row.
"""
cur.execute(
"SELECT * FROM bank_table WHERE bank=? AND parent_bank=?",
Expand Down Expand Up @@ -359,7 +359,7 @@ def get_sub_banks(bank):
get_sub_banks(row[0])

get_sub_banks(bank)
# if an exception occcurs while recursively deleting
# if an exception occurs while recursively deleting
# the parent banks, then throw the exception and roll
# back the changes made to the DB
except sqlite3.OperationalError as exc:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

def update_t_inactive(acct_conn, last_t_inactive, user, bank):
"""
Save the timestamp of the most recent inactive job for the assocation.
Save the timestamp of the most recent inactive job for the association.
"""
u_ts = """
UPDATE job_usage_factor_table SET last_job_timestamp=? WHERE username=? AND bank=?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def delete_project(conn, project):
cursor.execute(select_stmt, ("%" + project + "%",))
result = cursor.fetchall()
warning_stmt = (
"WARNING: user(s) in the assocation_table still "
"WARNING: user(s) in the association_table still "
"reference this project. Make sure to edit user rows to "
"account for this deleted project."
)
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/flux-account-priority-update.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def est_sqlite_conn(path):
if db_version < fluxacct.accounting.db_schema_version:
print(
"""flux-accounting database out of date; updating DB with """
"""'flux account-update-db' before sending infomation to plugin"""
"""'flux account-update-db' before sending information to plugin"""
)
# if flux account-update-db fails, we should not attempt to send data from
# the DB to the priority plugin, and instead we should abort
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/flux-account-service.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def list_banks(self, handle, watcher, msg, arg):
except ValueError as exc:
handle.respond_error(msg, 0, f"{exc}")
except sqlite3.Error as exc:
handle.respond_error(msg, 0, f"a SQLite error occured: {exc}")
handle.respond_error(msg, 0, f"a SQLite error occurred: {exc}")
except Exception as exc:
handle.respond_error(
msg, 0, f"a non-OSError exception was caught: {str(exc)}"
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/accounting.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Association {
json_t* to_json () const; // convert object to JSON string
};

// - UKNOWN_QUEUE: a queue is specified for a submitted job that flux-accounting
// - UNKNOWN_QUEUE: a queue is specified for a submitted job that flux-accounting
// does not know about
// - NO_QUEUE_SPECIFIED: no queue was specified for this job
// - INVALID_QUEUE: the association does not have permission to run jobs under
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/mf_priority.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ static int validate_cb (flux_plugin_t *p,
a = get_association (userid, bank, users, users_def_bank);

if (a == nullptr) {
// the assocation could not be found in the plugin's internal map,
// the association could not be found in the plugin's internal map,
// so perform a check to see if the map has any loaded
// flux-accounting data before rejecting the job
bool only_dne_data = check_map_for_dne_only (users, users_def_bank);
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/test/accounting_test01.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static void test_direct_map_access (
}


// ensure an Assocation* is returned on success
// ensure an Association* is returned on success
static void test_get_association_success ()
{
// retrieve user_bank_info object
Expand Down Expand Up @@ -180,7 +180,7 @@ static void test_get_queue_info_no_queue_specified ()
}


// ensure UNKOWN_QUEUE is returned when an unrecognized queue is passed in
// ensure UNKNOWN_QUEUE is returned when an unrecognized queue is passed in
static void test_get_queue_info_unknown_queue ()
{
Association a = users[1001]["bank_A"];
Expand Down
2 changes: 1 addition & 1 deletion src/test/checks_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export PATH=/usr/lib/ccache:$PATH
# Ensure ccache dir exists
mkdir -p $HOME/.ccache

# clang+ccache requries second cpp pass:
# clang+ccache requires second cpp pass:
if echo "$CC" | grep -q "clang"; then
CCACHE_CPP=1
fi
Expand Down
6 changes: 3 additions & 3 deletions t/sharness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export SHARNESS_VERSION
: ${SHARNESS_TEST_EXTENSION:=t}
export SHARNESS_TEST_EXTENSION

# Reset TERM to original terminal if found, otherwise save orignal TERM
# Reset TERM to original terminal if found, otherwise save original TERM
[ "x" = "x$SHARNESS_ORIG_TERM" ] &&
SHARNESS_ORIG_TERM="$TERM" ||
TERM="$SHARNESS_ORIG_TERM"
Expand Down Expand Up @@ -182,7 +182,7 @@ trap 'die' EXIT
# implicitly by specifying the prerequisite name in calls to test_expect_success
# or test_expect_failure.
#
# $1 - Name of prerequiste (a simple word, in all capital letters by convention)
# $1 - Name of prerequisite (a simple word, in all capital letters by convention)
#
# Examples
#
Expand Down Expand Up @@ -580,7 +580,7 @@ test_expect_code() {

# Public: Compare two files to see if expected output matches actual output.
#
# The TEST_CMP variable defines the command used for the comparision; it
# The TEST_CMP variable defines the command used for the comparison; it
# defaults to "diff -u". Only when the test script was started with --verbose,
# will the command's output, the diff, be printed to the standard output.
#
Expand Down
8 changes: 4 additions & 4 deletions t/t0000-sharness.t
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,12 @@ test_expect_success COLOR,PERL_AND_TTY 'sub-sharness still has color' "
test_expect_success 'EXPENSIVE prereq not activated by default' "
run_sub_test_lib_test no-long 'long test' <<-\\EOF &&
test_expect_success 'passing test' 'true'
test_expect_success EXPENSIVE 'passing suposedly long test' 'true'
test_expect_success EXPENSIVE 'passing supposedly long test' 'true'
test_done
EOF
check_sub_test_lib_test no-long <<-\\EOF
> ok 1 - passing test
> ok 2 # skip passing suposedly long test (missing EXPENSIVE)
> ok 2 # skip passing supposedly long test (missing EXPENSIVE)
> # passed all 2 test(s)
> 1..2
EOF
Expand All @@ -386,12 +386,12 @@ test_expect_success 'EXPENSIVE prereq not activated by default' "
test_expect_success 'EXPENSIVE prereq is activated by --long' "
run_sub_test_lib_test long 'long test' '' '--long' <<-\\EOF &&
test_expect_success 'passing test' 'true'
test_expect_success EXPENSIVE 'passing suposedly long test' 'true'
test_expect_success EXPENSIVE 'passing supposedly long test' 'true'
test_done
EOF
check_sub_test_lib_test long <<-\\EOF
> ok 1 - passing test
> ok 2 - passing suposedly long test
> ok 2 - passing supposedly long test
> # passed all 2 test(s)
> 1..2
EOF
Expand Down
2 changes: 1 addition & 1 deletion t/t1005-max-jobs-limits.t
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ test_expect_success 'a submitted job while at max-running-jobs limit will have a
flux cancel ${jobid2}
'

test_expect_success 'submit max number of jobs with a mix of default bank and explicity set bank' '
test_expect_success 'submit max number of jobs with a mix of default bank and explicitly set bank' '
jobid1=$(flux python ${SUBMIT_AS} 5011 sleep 60) &&
jobid2=$(flux python ${SUBMIT_AS} 5011 --setattr=system.bank=account3 -n 1 sleep 60)
'
Expand Down
2 changes: 1 addition & 1 deletion t/t1025-flux-account-projects.t
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ test_expect_success 'editing a user project list with a non-existing project sho
test_expect_success 'remove a project from the project_table that is still referenced by at least one user' '
flux account delete-project project_1 > warning_message.out &&
test_must_fail flux account view-project project_1 > deleted_project.out 2>&1 &&
grep "WARNING: user(s) in the assocation_table still reference this project." warning_message.out &&
grep "WARNING: user(s) in the association_table still reference this project." warning_message.out &&
grep "project project_1 not found in project_table" deleted_project.out
'

Expand Down
2 changes: 1 addition & 1 deletion t/t1033-mf-priority-update-job.t
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ test_expect_success 'check that job is still in original queue' '
grep "\"queue\": \"bronze\"" jobspec.out
'

test_expect_success 'update job with invalud combination (invalid queue)' '
test_expect_success 'update job with invalid combination (invalid queue)' '
test_must_fail flux update ${jobid} bank=B queue=gold > unavail_queue.out 2>&1 &&
test_debug "cat unavail_queue.out" &&
grep "ERROR: mf_priority: queue not valid for user: gold" unavail_queue.out
Expand Down

0 comments on commit 6d908f0

Please sign in to comment.