diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..518b377b0 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,14 @@ +--- +exclude: doc/attic/|doc/author_*|AUTHORS|COPYING|example/linksc/COPYING|iniparser/LICENSE|libb64/README|config/ax_prefix_config_h.m4 +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - id: check-added-large-files + - repo: https://github.com/crate-ci/typos + rev: v1.36.2 + hooks: + - id: typos diff --git a/AUTHORS b/AUTHORS index 545794d87..5dcc592e7 100644 --- a/AUTHORS +++ b/AUTHORS @@ -58,7 +58,7 @@ Advanced Computing Center (TACC) for providing them with access to the Ranger supercomputer under NSF TeraGrid award MCA04N026, and the National Center for Computational Science (NCCS) for early-user access to the Jaguar Cray XT5 - supercomputer. Any opinions, findings and conclusions or recomendations + supercomputer. Any opinions, findings and conclusions or recommendations expressed in the source code and documentation are those of the authors and do not necessarily reflect the views of the National Science Foundation (NSF). @@ -85,7 +85,7 @@ domain software, see the LICENSE and AUTHORS files in that directory. The files under iniparser are derived from iniparser3.0b. iniparser is - licensed unter the MIT license, see the LICENSE and AUTHORS files in + licensed under the MIT license, see the LICENSE and AUTHORS files in that directory. Several scripts under config are released under GNU GPL versions. diff --git a/INSTALL b/INSTALL index 8b82ade08..c9fd2c0c3 100644 --- a/INSTALL +++ b/INSTALL @@ -288,4 +288,3 @@ operates. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. - diff --git a/NEWS b/NEWS index 37f8162d0..778215f95 100644 --- a/NEWS +++ b/NEWS @@ -3,7 +3,7 @@ NEWS * The current stable version 2 of the libsc code is maintained in branches v2.2--v2.5. It will be backwards compatible as much as possible. - The code will remain usable and bugfixed for the forseeable future. + The code will remain usable and bugfixed for the foreseeable future. The branches master (official) and develop (fairly stable) live here. * We have introduced a new development branch leading up to v3.0. The initial version is v2.8. The branch is called prev3-develop. On diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 000000000..20175c124 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,8 @@ +#[default.extend-words] + +[default.extend-identifiers] +sc_MPI_MODE_WRONLY = "sc_MPI_MODE_WRONLY" +MPI_MODE_WRONLY = "MPI_MODE_WRONLY" +PNGs = "PNGs" +asend = "asend" +nce = "nce" diff --git a/config/sc_include.m4 b/config/sc_include.m4 index aea0297d0..17e4c6b19 100644 --- a/config/sc_include.m4 +++ b/config/sc_include.m4 @@ -127,7 +127,7 @@ dnl its INVOCATION is one valid statement of a C/C++ program. dnl It may require INCLUDE statements to compile and link ok. dnl On the inside we call AC_LANG_PROGRAM(INCLUDE, INVOCATION). dnl The SEARCH_LIBS are a white-space separated list or empty. -dnl The OTHER_LIBS may be empty or a list of depency libraries. +dnl The OTHER_LIBS may be empty or a list of dependency libraries. dnl dnl This macro is modified from AC_SEARCH_LIBS. In particular, dnl we use a separate cache variable ac_cv_sc_search_FUNCTION. diff --git a/config/sc_mpi.m4 b/config/sc_mpi.m4 index 369c31a78..775cba914 100644 --- a/config/sc_mpi.m4 +++ b/config/sc_mpi.m4 @@ -495,7 +495,7 @@ dnl This was only used for our lint code, which needs to be replaced. dnl dnl dnl SC_MPI_INCLUDES dnl dnl Call the compiler with various --show* options -dnl dnl to figure out the MPI_INCLUDES and MPI_INCLUDE_PATH varables +dnl dnl to figure out the MPI_INCLUDES and MPI_INCLUDE_PATH variables dnl dnl dnl AC_DEFUN([SC_MPI_INCLUDES], dnl [ diff --git a/config/sc_package.m4 b/config/sc_package.m4 index 241523295..dafdab401 100644 --- a/config/sc_package.m4 +++ b/config/sc_package.m4 @@ -107,7 +107,7 @@ $1_$3_RPATH= $1_DISTCLEAN="$$1_DISTCLEAN $1_$3_SOURCE.log" SC_ARG_WITH_PREFIX([$4], - [specifiy how to depend on package $4 (optional). + [specify how to depend on package $4 (optional). If the option value is literal no or the option is not present, use the source subdirectory. If the option value is the literal external, expect all necessary environment variables to be set to compile and link against diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index c1f53f574..30d029419 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -457,7 +457,7 @@ LOOKUP_CACHE_SIZE = 0 # than 0 to get more control over the balance between CPU load and processing # speed. At this moment only the input processing can be done using multiple # threads. Since this is still an experimental feature the default is set to 1, -# which efficively disables parallel processing. Please report any issues you +# which effectively disables parallel processing. Please report any issues you # encounter. Generating dot graphs in parallel is controlled by the # DOT_NUM_THREADS setting. # Minimum value: 0, maximum value: 32, default value: 1. diff --git a/doc/coding_standards.txt b/doc/coding_standards.txt index aaa1e8e00..f9bedbcef 100644 --- a/doc/coding_standards.txt +++ b/doc/coding_standards.txt @@ -62,7 +62,7 @@ tries to adhere to. printf ("%jd %ju", (intmax_t) i, (uintmax_t) u); - since that would be a nice way to accomodate 128 bit integers without + since that would be a nice way to accommodate 128 bit integers without changing the `printf` code. This also holds for `size_t` since support for the following is still incomplete: diff --git a/doc/mainpage.dox b/doc/mainpage.dox index bcffba930..07137c90f 100644 --- a/doc/mainpage.dox +++ b/doc/mainpage.dox @@ -100,7 +100,7 @@ * * This file contains routines for parallel I/O format. * In particular there are functions to write and read data in parallel according - * to a user prescribed partition of contigously indexed potentially + * to a user prescribed partition of contiguously indexed potentially * variable-sized elements. In addition, the user can also write and read * data in serial and the data can be stored element-wise compressed. * diff --git a/doc/portability/portitm4.sh b/doc/portability/portitm4.sh index 92cd9d9eb..7775f6fe5 100755 --- a/doc/portability/portitm4.sh +++ b/doc/portability/portitm4.sh @@ -18,4 +18,3 @@ perl -p -i \ -e 's,test\s+"\$,test "x\$,;' \ -e 's,=\s+"?x?(yes|no|unknown|disable)"?,= x\1,;' \ "$FILE" - diff --git a/example/openmp/juqueen_job.js b/example/openmp/juqueen_job.js index bdd020f88..825c436bb 100644 --- a/example/openmp/juqueen_job.js +++ b/example/openmp/juqueen_job.js @@ -1,6 +1,6 @@ -# This jobscript can be submitted to the juqueen +# This jobscript can be submitted to the juqueen # job queue via llsubmit [script] -# Do not forget to put your email adress in the +# Do not forget to put your email address in the # notify_user field. # # This script has to be executed within the folder of diff --git a/iniparser/dictionary.c b/iniparser/dictionary.c index f66cbfc6d..a47d7a567 100644 --- a/iniparser/dictionary.c +++ b/iniparser/dictionary.c @@ -6,7 +6,7 @@ This module implements a simple dictionary object, i.e. a list of string/string associations. This object is useful to store e.g. - informations retrieved from a configuration file (ini files). + information retrieved from a configuration file (ini files). */ /*--------------------------------------------------------------------------*/ @@ -107,7 +107,7 @@ unsigned dictionary_hash(const char * key) /** @brief Create a new dictionary object. @param size Optional initial size of the dictionary. - @return 1 newly allocated dictionary objet. + @return 1 newly allocated dictionary object. This function allocates a new dictionary object of given size and returns it. If you do not know in advance (roughly) the number of entries in the diff --git a/iniparser/dictionary.h b/iniparser/dictionary.h index 2a1c2d1cd..e573a8d23 100644 --- a/iniparser/dictionary.h +++ b/iniparser/dictionary.h @@ -7,7 +7,7 @@ This module implements a simple dictionary object, i.e. a list of string/string associations. This object is useful to store e.g. - informations retrieved from a configuration file (ini files). + information retrieved from a configuration file (ini files). */ /*--------------------------------------------------------------------------*/ @@ -89,7 +89,7 @@ unsigned dictionary_hash(const char * key); /** @brief Create a new dictionary object. @param size Optional initial size of the dictionary. - @return 1 newly allocated dictionary objet. + @return 1 newly allocated dictionary object. This function allocates a new dictionary object of given size and returns it. If you do not know in advance (roughly) the number of entries in the diff --git a/iniparser/iniexample.c b/iniparser/iniexample.c index 492c89220..c6a829bce 100644 --- a/iniparser/iniexample.c +++ b/iniparser/iniexample.c @@ -79,18 +79,16 @@ static int parse_ini_file(const char * ini_name) printf("Wine:\n"); s = iniparser_getstring(ini, "wine:grape", NULL); printf("Grape: [%s]\n", s ? s : "UNDEF"); - + i = iniparser_getint(ini, "wine:year", -1); printf("Year: [%d]\n", i); s = iniparser_getstring(ini, "wine:country", NULL); printf("Country: [%s]\n", s ? s : "UNDEF"); - + d = iniparser_getdouble(ini, "wine:alcohol", -1.0); printf("Alcohol: [%g]\n", d); iniparser_freedict(ini); return 0 ; } - - diff --git a/iniparser/iniparser.c b/iniparser/iniparser.c index 816913179..035389430 100644 --- a/iniparser/iniparser.c +++ b/iniparser/iniparser.c @@ -78,9 +78,9 @@ static char * strstrip(const char * s) { static char l[ASCIILINESZ+1]; char * last ; - + if (s==NULL) return NULL ; - + while (isspace((int)*s) && *s) s++; memset(l, 0, ASCIILINESZ+1); sc3_strcopy (l, ASCIILINESZ + 1, s); @@ -295,7 +295,7 @@ int iniparser_getsecnkeys(dictionary * d, char * s) for (j=0 ; jsize ; j++) { if (d->key[j]==NULL) continue ; - if (!strncmp(d->key[j], keym, seclen+1)) + if (!strncmp(d->key[j], keym, seclen+1)) nkeys++; } @@ -313,7 +313,7 @@ int iniparser_getsecnkeys(dictionary * d, char * s) This function queries a dictionary and finds all keys in a given section. Each pointer in the returned char pointer-to-pointer is pointing to a string allocated in the dictionary; do not free or modify them. - + This function returns NULL in case of error. */ /*--------------------------------------------------------------------------*/ @@ -337,7 +337,7 @@ char ** iniparser_getseckeys(dictionary * d, char * s) seclen = (int)strlen(s); sc3_snprintf (keym, ASCIILINESZ + 1, "%s:", s); - + i = 0; for (j=0 ; jsize ; j++) { @@ -563,7 +563,7 @@ static line_status iniparser_line( char * section, char * key, char * value) -{ +{ line_status sta ; char line[ASCIILINESZ+1]; int len ; @@ -577,7 +577,7 @@ static line_status iniparser_line( sta = LINE_EMPTY ; } else if (line[0]=='#' || line[0]==';') { /* Comment line */ - sta = LINE_COMMENT ; + sta = LINE_COMMENT ; } else if (line[0]=='[' && line[len-1]==']') { /* Section name */ sscanf(line, "[%[^]]", section); diff --git a/src/sc.c b/src/sc.c index 30d03dae0..bc30e55b1 100644 --- a/src/sc.c +++ b/src/sc.c @@ -1046,7 +1046,7 @@ void sc_abort (void) { sc_default_abort_handler (); - abort (); /* if the user supplied callback incorrecty returns, abort */ + abort (); /* if the user supplied callback incorrectly returns, abort */ } static void diff --git a/src/sc.h b/src/sc.h index 7720053b7..a163c67cb 100644 --- a/src/sc.h +++ b/src/sc.h @@ -467,7 +467,7 @@ void SC_CHECK_ABORTF (int success, SC_PRINTF_FMT const char *fmt, #define SC_LP_SILENT 9 /**< Never log anything. Instead suggesting \ref SC_LP_ERROR. */ /** @} */ -/* The default log priority may be overridded by this preprocessor define. */ +/* The default log priority may be overridden by this preprocessor define. */ #ifdef SC_LOG_PRIORITY #define SC_LP_THRESHOLD SC_LOG_PRIORITY #define SC_LP_APPLICATION SC_LOG_PRIORITY diff --git a/src/sc_builtin/getopt_int.h b/src/sc_builtin/getopt_int.h index d982c72d9..9b8e30350 100644 --- a/src/sc_builtin/getopt_int.h +++ b/src/sc_builtin/getopt_int.h @@ -26,7 +26,7 @@ extern int _getopt_internal (int ___argc, char *const *___argv, const struct option *__longopts, int *__longind, int __long_only); - + /* Reentrant versions which can handle parsing multiple argument vectors at the same time. */ diff --git a/src/sc_camera.h b/src/sc_camera.h index be203c473..735fbbddf 100644 --- a/src/sc_camera.h +++ b/src/sc_camera.h @@ -362,7 +362,7 @@ void sc_camera_get_view_mat (const sc_camera_t * camera, * device coordinates (NDC). * * 1. Switch from right-handed to left-handed coordinate system by negating the z-axis. - * 2. Apply the perpective projection into the cuboid + * 2. Apply the perspective projection into the cuboid * [-2/s_x, 2/s_x] x [-2/s_y, 2/s_y] x [n,f] with use of homogeneous coordinates. * Here s_x and s_y are width and height of the visible picture on the near plane. * 3. Map the cuboid to the NDC cube [-1, 1]^3. diff --git a/src/sc_io.c b/src/sc_io.c index 4cfc7b813..98092c720 100644 --- a/src/sc_io.c +++ b/src/sc_io.c @@ -1485,7 +1485,7 @@ sc_io_error_class (int errorcode, int *errorclass) if (errorcode == 0) { /* This is the errno for no error or - * possibly also the sc_MPI_SUCESS value. + * possibly also the sc_MPI_SUCCESS value. * In both cases, we want to set errorclass to * sc_MPI_SUCCESS. */ diff --git a/src/sc_scda.c b/src/sc_scda.c index 113865bae..a3a56624f 100644 --- a/src/sc_scda.c +++ b/src/sc_scda.c @@ -93,9 +93,9 @@ #define SC_SCDA_CHECK_VERBOSE_NONCOLL(lp, errcode, msg) SC_SCDA_CHECK_VERBOSE_GEN (\ errcode, msg, SC_LOGF, lp) -/** Collectivly check a given errorcode. +/** Collectively check a given errorcode. * This macro assumes that errcode is a collective - * variable and that the macro is called collectivly. + * variable and that the macro is called collectively. * The calling function must return NULL in case of an error. */ #define SC_SCDA_CHECK_COLL_ERR(errcode, fc, user_msg) do { \ @@ -395,7 +395,7 @@ sc_scda_pad_to_fix_len_inplace (const char *input_data, size_t input_len, * \param [out] raw_len The length of \b raw_data in number of bytes. * Undefined if the function returns true. * \return True if \b padded_data does not satisfy the - * scda padding convention for fixed-length paddding. + * scda padding convention for fixed-length padding. * False, otherwise. */ static int @@ -449,7 +449,7 @@ sc_scda_check_pad_to_fix_len (const char *padded_data, size_t pad_len, * \param [out] raw_len The length of \b raw_data in number of bytes. * Undefined if the function returns true. * \return True if \b padded_data does not satisfy the - * scda padding convention for fixed-length paddding. + * scda padding convention for fixed-length padding. * False, otherwise. */ static int @@ -1214,7 +1214,7 @@ sc_scda_params_init (sc_scda_params_t *params) #endif } -/** This function peforms the start up for both scda fopen functions. +/** This function performs the start up for both scda fopen functions. * * \param [in] params The sc_scda_params_t structure that is * passed to the scda fopen function. \b params may be @@ -1452,7 +1452,7 @@ sc_scda_fopen_write (sc_MPI_Comm mpicomm, mpiret = sc_io_open (mpicomm, filename, SC_IO_WRITE_CREATE, info, &fc->file); sc_scda_mpiret_to_errcode (mpiret, errcode, fc); - /* We call a macro for checking an error that occurs collectivly. + /* We call a macro for checking an error that occurs collectively. * In case of an error the macro prints an error message using \ref * SC_GLOBAL_LERRORF, closes the file and frees fc. */ diff --git a/src/sc_scda.h b/src/sc_scda.h index b673655e9..775c7fa55 100644 --- a/src/sc_scda.h +++ b/src/sc_scda.h @@ -54,7 +54,7 @@ * the process count can differ between writing and reading. * * The main purpose of \b scda is to enable the user to implement parallel I/O - * for numerical appliations, e.g. simulation checkpoint/restart. + * for numerical applications, e.g. simulation checkpoint/restart. * * We elaborate further on the workflow in \ref scda_workflow. * @@ -271,7 +271,7 @@ sc_scda_ret_t; * The parsing logic of \ref sc_scda_ferror_t is that first \b scdaret is examined * and if \b scdaret != \ref SC_SCDA_FERR_MPI, we know that \b mpiret = 0. * If \b scdaret = \ref SC_SCDA_FERR_MPI, we know that an MPI error occurred and - * we can examine \b mpiret for more informartion. + * we can examine \b mpiret for more information. * * Moreover, a valid sc_scda_ferror always satisfy that if \b scdaret = 0 then * \b mpiret = 0 and if \b scdaret = \ref SC_SCDA_FERR_MPI then \b mpiret !=0. @@ -550,7 +550,7 @@ sc_scda_fcontext_t *sc_scda_fwrite_block (sc_scda_fcontext_t * fc, * \param [in] indirect A Boolean to determine whether \b array_data * must be a sc_array of sc_arrays to write * indirectly and in particular from potentially - * non-contigous memory. In the remaining case of + * non-contiguous memory. In the remaining case of * \b indirect being false \b array_data must be * a sc_array with element size equals to * \b elem_size that contains the actual array @@ -682,7 +682,7 @@ int sc_scda_proc_sizes (sc_array_t * elem_sizes, * \param [in] indirect A Boolean to determine whether \b array_data * must be a sc_array of sc_arrays to write * indirectly and in particular from potentially - * non-contigous memory. In the remaining case of + * non-contiguous memory. In the remaining case of * \b indirect being false \b array_data must be * a sc_array with the actual array elements as * data as further explained in the documentation @@ -810,7 +810,7 @@ sc_scda_fcontext_t *sc_scda_fopen_read (sc_MPI_Comm mpicomm, * true. For \b decode true as input the file * section is interpreted as a compressed file * section if the type and user string of the first - * raw file section satisfiy the compression + * raw file section satisfy the compression * convention. If the compression convention is not * satisfied the data is read raw. For false as * input the data will be read raw by the @@ -969,7 +969,7 @@ sc_scda_fcontext_t *sc_scda_fread_block_data (sc_scda_fcontext_t * fc, * \param [in] indirect A Boolean to determine whether \b array_data * must be a sc_array of sc_arrays to read * indirectly and in particular to potentially - * non-contigous memory. See the documentation of + * non-contiguous memory. See the documentation of * the parameter \b array_data for more information. * \param [out] errcode An errcode that can be interpreted by \ref * sc_scda_ferror_string or mapped to an error class @@ -1102,7 +1102,7 @@ sc_scda_fcontext_t *sc_scda_fread_varray_sizes (sc_scda_fcontext_t * fc, * \param [in] indirect A Boolean to determine whether \b array_data * must be a sc_array of sc_arrays to read * indirectly and in particular to potentially - * non-contigous memory. See the documentation of + * non-contiguous memory. See the documentation of * the parameter \b array_data for more information. * \param [out] errcode An errcode that can be interpreted by \ref * sc_scda_ferror_string or mapped to an error class