crate-ci / typos

Source code spell checker
Apache License 2.0
2.65k stars 108 forks source link

`exclude` patterns are evaluated with the target's directory as the root #269

Closed vsoch closed 3 years ago

vsoch commented 3 years ago

I'm trying to add typos to spack, and when I add exclude it doesn't seem to honor my request:

$ typos --exclude ./lib/spack/spack/test/ ./lib/spack/spack/ ./lib/spack/docs/

E.g., I need to test everything in lib/spack/spack but not the test directory. It still shows up for the check!

error: `ect` should be `etc`
  --> ./lib/spack/spack/test/data/config/spackdump.json:412:38
    |
412 |           "hash": "kqul2pqqzcpobrd6fh6ect7d3sxlvvks",

I wonder if it would be possible (for code) to only check docstrings and comments, and ignore code? That would resolve a few issues with typos trying to "fix" variable names.


The difference is in

$ typos --exclude ./lib/spack/spack/test/

vs

$ typos --exclude ./lib/spack/spack/test/ ./lib/spack/spack/ ./lib/spack/docs/

We are treating that exclude as

Workaround: --exclude test. This will be stable across fixes; it just might exclude more

epage commented 3 years ago

Not sure what is going on, --exclude seems to be working for me.

Hmm, this is also making me reconsider that idea of detecting hashes and ignoring them (created #270)

I ran

cargo run --manifest-path ../typos/Cargo.toml -- --exclude ./lib/spack/spack/test/ ./lib/spack/spack/ ./lib/spack/docs/ --format brief

And got

./var/spack/repos/builtin/packages/dd4hep/package.py:57:29: `addtion` -> `addition`
./var/spack/repos/builtin/packages/py-azure-cli/package.py:51:30: `hdinsight` -> `hindsight`
./var/spack/repos/builtin/packages/rust/package.py:89:49: `simplicitly` -> `simplicity`
./var/spack/repos/builtin/packages/llvm/package.py:389:51: `priviliges` -> `privileges`
./var/spack/repos/builtin/packages/llvm/package.py:574:20: `seperated` -> `separated`
./var/spack/repos/builtin/packages/openfoam-org/package.py:240:64: `similiarly` -> `similarly`
./var/spack/repos/builtin/packages/precice/package.py:9:6: `Precice` -> `Precise`
./var/spack/repos/builtin/packages/precice/package.py:16:28: `precice` -> `precise`
./var/spack/repos/builtin/packages/precice/package.py:17:35: `precice` -> `precise`
./var/spack/repos/builtin/packages/precice/package.py:17:43: `precice` -> `precise`
./var/spack/repos/builtin/packages/precice/package.py:18:35: `precice` -> `precise`
./var/spack/repos/builtin/packages/precice/package.py:18:43: `precice` -> `precise`
./var/spack/repos/builtin/packages/precice/package.py:75:40: `precice` -> `precise`
./var/spack/repos/builtin/packages/precice/package.py:84:29: `PRECICE` -> `PRECISE`
./var/spack/repos/builtin/packages/precice/package.py:87:29: `PRECICE` -> `PRECISE`
./var/spack/repos/builtin/packages/precice/package.py:90:29: `PRECICE` -> `PRECISE`
./var/spack/repos/builtin/packages/star-ccm-plus/package.py:32:59: `occured` -> `occurred`
./var/spack/repos/builtin/packages/r-txdb-hsapiens-ucsc-hg18-knowngene/package.py:15:41: `ther` -> `there`, `their`, `the`
./var/spack/repos/builtin/packages/intel-tbb/package.py:26:43: `daed` -> `dead`
./var/spack/repos/builtin/packages/dihydrogen/package.py:122:6: `Idenfity` -> `Identify`
./var/spack/repos/builtin/packages/py-coveralls/package.py:19:57: `useage` -> `usage`
./var/spack/repos/builtin/packages/mpt/package.py:13:21: `proprietry` -> `proprietary`
./var/spack/repos/builtin/packages/opencv/opencv3.2_python3.7.patch:5:15: `compatability` -> `compatibility`
./var/spack/repos/builtin/packages/opencv/opencv3.2_ffmpeg.patch:29:47: `seperate` -> `separate`
./var/spack/repos/builtin/packages/opencv/opencv3.2_ffmpeg.patch:96:51: `seperate` -> `separate`
./var/spack/repos/builtin/packages/cquery/package.py:10:66: `wih` -> `with`
./var/spack/repos/builtin/packages/glib/meson-gettext.patch:5:64: `uncompatible` -> `incompatible`
./var/spack/repos/builtin/packages/glib/meson-gettext-2.66.patch:4:64: `uncompatible` -> `incompatible`
./var/spack/repos/builtin/packages/hpcc/package.py:182:46: `successfull` -> `successful`
./var/spack/repos/builtin/packages/hpcc/package.py:194:50: `successfull` -> `successful`
./var/spack/repos/builtin/packages/py-azure-mgmt-hdinsight/package.py:7:17: `Hdinsight` -> `Hindsight`
./var/spack/repos/builtin/packages/py-azure-mgmt-hdinsight/package.py:11:23: `hdinsight` -> `hindsight`
./var/spack/repos/builtin/packages/py-azure-mgmt-hdinsight/package.py:11:44: `hdinsight` -> `hindsight`
./var/spack/repos/builtin/packages/miniaero/package.py:11:65: `evaulation` -> `evaluation`
./var/spack/repos/builtin/packages/py-ucsf-pyem/package.py:34:41: `useage` -> `usage`
./var/spack/repos/builtin/packages/idba/package.py:13:36: `alse` -> `else`
./var/spack/repos/builtin/packages/nektools/package.py:130:29: `becasue` -> `because`
./var/spack/repos/builtin/packages/oce/null.patch:227:59: `Lenght` -> `Length`
./var/spack/repos/builtin/packages/php/package.py:47:42: `embeded` -> `embedded`
./var/spack/repos/builtin/packages/py-pyprecice/package.py:15:28: `precice` -> `precise`
./var/spack/repos/builtin/packages/py-pyprecice/package.py:16:30: `precice` -> `precise`
./var/spack/repos/builtin/packages/py-pyprecice/package.py:17:30: `precice` -> `precise`
./var/spack/repos/builtin/packages/py-pyprecice/deactivate-version-check-via-pip.patch:18:168: `occour` -> `occur`
./var/spack/repos/builtin/packages/py-pyprecice/deactivate-version-check-via-pip.patch:18:211: `precice` -> `precise`
./var/spack/repos/builtin/packages/py-pyprecice/package.py:36:16: `precice` -> `precise`
./var/spack/repos/builtin/packages/py-pyprecice/package.py:37:16: `precice` -> `precise`
./var/spack/repos/builtin/packages/py-pyprecice/package.py:38:16: `precice` -> `precise`
./var/spack/repos/builtin/packages/py-pyprecice/package.py:39:16: `precice` -> `precise`
./var/spack/repos/builtin/packages/py-pyprecice/package.py:40:16: `precice` -> `precise`
./var/spack/repos/builtin/packages/py-pyprecice/deactivate-version-check-via-pip.patch:22:164: `occour` -> `occur`
./var/spack/repos/builtin/packages/py-pyprecice/package.py:41:16: `precice` -> `precise`
./var/spack/repos/builtin/packages/py-pyprecice/package.py:42:16: `precice` -> `precise`
./var/spack/repos/builtin/packages/py-pyprecice/deactivate-version-check-via-pip.patch:22:207: `precice` -> `precise`
./var/spack/repos/builtin/packages/py-pyprecice/package.py:54:38: `precice` -> `precise`
./var/spack/repos/builtin/packages/py-pyprecice/package.py:55:38: `precice` -> `precise`
./var/spack/repos/builtin/packages/py-pyprecice/deactivate-version-check-via-pip.patch:24:196: `precice` -> `precise`
./var/spack/repos/builtin/packages/py-pyprecice/deactivate-version-check-via-pip.patch:29:192: `precice` -> `precise`
./var/spack/repos/builtin/packages/py-yolk3k/package.py:11:35: `avilable` -> `available`
./var/spack/repos/builtin/packages/satsuma2/package.py:13:17: `accomodate` -> `accommodate`
./var/spack/repos/builtin/packages/hip/package.py:157:10: `infered` -> `inferred`
./var/spack/repos/builtin/packages/py-charm4py/py-charm4py.makefile.patch:11:53: `occured` -> `occurred`
./var/spack/repos/builtin/packages/py-charm4py/py-charm4py.makefile.patch:16:53: `occured` -> `occurred`
./var/spack/repos/builtin/packages/half/package.py:17:26: `neccessary` -> `necessary`
./var/spack/repos/builtin/packages/mirdeep2/package.py:47:40: `sucessful` -> `successful`
./var/spack/repos/builtin/packages/dyninst/stat_dysect.patch:25:33: `proces` -> `process`
./var/spack/repos/builtin/packages/openmpi/package.py:369:44: `absense` -> `absence`
./var/spack/repos/builtin/packages/openfoam/1612-spack-patches.patch:464:31: `ther` -> `there`, `their`, `the`
./var/spack/repos/builtin/packages/openfoam/package.py:610:14: `similiarly` -> `similarly`
./var/spack/repos/builtin/packages/r-dss/package.py:13:24: `detectes` -> `detects`
./var/spack/repos/builtin/packages/cuda/package.py:195:29: `Compatability` -> `Compatibility`
./var/spack/repos/builtin/packages/quantum-espresso/package.py:318:57: `explictly` -> `explicitly`
./var/spack/repos/builtin/packages/quantum-espresso/package.py:350:16: `seperate` -> `separate`
./var/spack/repos/builtin/packages/quantum-espresso/package.py:381:25: `upsteam` -> `upstream`
./var/spack/repos/builtin/packages/py-pyside2/package.py:16:10: `offical` -> `official`
./var/spack/repos/builtin/packages/foam-extend/package.py:245:64: `similiarly` -> `similarly`
./var/spack/repos/builtin/packages/magics/resolve_isnan_ambiguity.patch:6:30: `Interpretor` -> `Interpreter`
./var/spack/repos/builtin/packages/magics/resolve_isnan_ambiguity.patch:7:30: `Interpretor` -> `Interpreter`
./var/spack/repos/builtin/packages/magics/resolve_isnan_ambiguity.patch:22:32: `Interpretor` -> `Interpreter`
./var/spack/repos/builtin/packages/magics/resolve_isnan_ambiguity.patch:23:32: `Interpretor` -> `Interpreter`
./var/spack/repos/builtin/packages/magics/resolve_isnan_ambiguity.patch:30:34: `Interpretor` -> `Interpreter`
./var/spack/repos/builtin/packages/magics/resolve_isnan_ambiguity.patch:31:34: `Interpretor` -> `Interpreter`
./var/spack/repos/builtin/packages/magics/resolve_isnan_ambiguity.patch:35:29: `Interpretor` -> `Interpreter`
./var/spack/repos/builtin/packages/magics/resolve_isnan_ambiguity.patch:36:29: `Interpretor` -> `Interpreter`
./var/spack/repos/builtin/packages/paraview/vtkm-catalyst-pv551.patch:463:42: `paramters` -> `parameters`
./var/spack/repos/builtin/packages/py-pygpu/package.py:11:14: `packge` -> `package`
./var/spack/repos/builtin/packages/py-wincertstore/package.py:11:33: `sytem` -> `system`
./var/spack/repos/builtin/packages/boost/call_once_variadic.patch:55:57: `FUNTION` -> `FUNCTION`
./var/spack/repos/builtin/packages/boost/package.py:144:52: `suport` -> `support`
./var/spack/repos/builtin/packages/openfoam-org/assets/bin/foamEtcFile:332:30: `ther` -> `there`, `their`, `the`
./var/spack/repos/builtin/packages/openblas/openblas-0.3.2-cmake.patch:39:68: `RELA` -> `REAL`
./var/spack/repos/builtin/packages/nek5000/package.py:132:59: `becasue` -> `because`
./var/spack/repos/builtin/packages/workrave/package.py:71:60: `explict` -> `explicit`
./var/spack/repos/builtin/packages/libcudf/package.py:34:31: `DEPRICATION` -> `DEPRIVATION`
./var/spack/repos/builtin/packages/exabayes/package.py:21:41: `succesfully` -> `successfully`
./var/spack/repos/builtin/packages/geopm/package.py:16:8: `propper` -> `proper`
./var/spack/repos/builtin/packages/libmad/package.py:23:12: `orignally` -> `originally`
./var/spack/repos/builtin/packages/r-rminer/package.py:19:25: `NMAE` -> `NAME`
./var/spack/repos/builtin/packages/parallel-netcdf/package.py:62:6: `Suport` -> `Support`
./var/spack/repos/builtin/packages/cosmomc/package.py:85:24: `satifies` -> `satisfies`
./var/spack/repos/builtin/packages/zip/05-typo-it-is-preceding-not-preceeding.patch:28: `preceeding` -> `preceding`
./var/spack/repos/builtin/packages/zip/05-typo-it-is-preceding-not-preceeding.patch:2:23: `preceeding` -> `preceding`
./var/spack/repos/builtin/packages/zip/05-typo-it-is-preceding-not-preceeding.patch:11:1: `preceeding` -> `preceding`
./var/spack/repos/builtin/packages/zip/05-typo-it-is-preceding-not-preceeding.patch:22:56: `preceeding` -> `preceding`
./var/spack/repos/builtin/packages/zip/package.py:19:42: `transfering` -> `transferring`
./var/spack/repos/builtin/packages/zip/package.py:20:40: `priviliges` -> `privileges`
./var/spack/repos/builtin/packages/zip/package.py:23:39: `preceeding` -> `preceding`
./var/spack/repos/builtin/packages/zip/01-typo-it-is-transferring-not-transfering.patch:31: `transfering` -> `transferring`
./var/spack/repos/builtin/packages/zip/01-typo-it-is-transferring-not-transfering.patch:2:23: `transfering` -> `transferring`
./var/spack/repos/builtin/packages/zip/01-typo-it-is-transferring-not-transfering.patch:12:32: `transfering` -> `transferring`
./var/spack/repos/builtin/packages/zip/02-typo-it-is-privileges-not-priviliges.patch:29: `priviliges` -> `privileges`
./var/spack/repos/builtin/packages/zip/02-typo-it-is-privileges-not-priviliges.patch:2:23: `priviliges` -> `privileges`
./var/spack/repos/builtin/packages/zip/01-typo-it-is-transferring-not-transfering.patch:23:14: `transfering` -> `transferring`
./var/spack/repos/builtin/packages/zip/02-typo-it-is-privileges-not-priviliges.patch:12:13: `priviliges` -> `privileges`
./var/spack/repos/builtin/packages/zip/02-typo-it-is-privileges-not-priviliges.patch:23:29: `priviliges` -> `privileges`
./var/spack/repos/builtin/packages/kokkos/package.py:73:66: `dispath` -> `dispatch`
./var/spack/repos/builtin/packages/fenics/package.py:63:6: `Conflics` -> `Conflicts`
./var/spack/repos/builtin/packages/fenics/petsc-3.7.patch:335:52: `explictly` -> `explicitly`
./var/spack/repos/builtin/packages/roctracer-dev/package.py:13:50: `asyncronous` -> `asynchronous`
./var/spack/repos/builtin/packages/sgpp/fix-setup-py.patch:19:57: `correponding` -> `corresponding`
./var/spack/repos/builtin/packages/sgpp/ocl.patch:9:57: `Frome` -> `From`
./var/spack/repos/builtin/packages/vtk/package.py:60:24: `buidling` -> `building`
./var/spack/repos/builtin/packages/athena/package.py:61:21: `strat` -> `start`
./var/spack/repos/builtin/packages/athena/package.py:62:21: `strat` -> `start`
./var/spack/repos/builtin/packages/athena/package.py:71:17: `strat` -> `start`
./var/spack/repos/builtin/packages/intltool/package.py:24:15: `witn` -> `with`
./var/spack/repos/builtin/packages/denovogear/package.py:13:24: `positve` -> `positive`
./var/spack/repos/builtin/packages/nanoflann/package.py:10:66: `wih` -> `with`
./var/spack/repos/builtin/packages/icarus/fix-gcc-10.patch:13:10: `accroding` -> `according`
./var/spack/repos/builtin/packages/py-poster/python3.patch:358:56: `excercise` -> `exercise`
./var/spack/repos/builtin/packages/ucx/package.py:114:13: `paramter` -> `parameter`
./var/spack/repos/builtin/packages/tcl-itcl/package.py:12:13: `inheritence` -> `inheritance`
./var/spack/repos/builtin/packages/py-pyside/package.py:15:10: `offical` -> `official`
./var/spack/repos/builtin/packages/legion/package.py:193:54: `optimizaton` -> `optimization`
./var/spack/repos/builtin/packages/legion/README.md:76:10: `TOOD` -> `TODO`
./var/spack/repos/builtin/packages/legion/README.md:80:10: `TOOD` -> `TODO`
./var/spack/repos/builtin/packages/xsdk/package.py:39:13: `precice` -> `precise`
./var/spack/repos/builtin/packages/xsdk/package.py:40:32: `precice` -> `precise`
./var/spack/repos/builtin/packages/py-nbconvert/style.min.css:12:15953: `adn` -> `and`
./var/spack/repos/builtin/packages/xsdk/package.py:209:16: `precice` -> `precise`
./var/spack/repos/builtin/packages/xsdk/package.py:209:54: `precice` -> `precise`
./var/spack/repos/builtin/packages/xsdk/package.py:210:16: `precice` -> `precise`
./var/spack/repos/builtin/packages/xsdk/package.py:210:50: `precice` -> `precise`
./var/spack/repos/builtin/packages/xsdk/package.py:211:16: `precice` -> `precise`
./var/spack/repos/builtin/packages/xsdk/package.py:211:46: `precice` -> `precise`
./var/spack/repos/builtin/packages/xsdk/package.py:212:16: `precice` -> `precise`
./var/spack/repos/builtin/packages/xsdk/package.py:212:46: `precice` -> `precise`
./var/spack/repos/builtin/packages/xsdk/package.py:234:54: `propogate` -> `propagate`
./var/spack/repos/builtin/packages/esmf/package.py:214:45: `seperate` -> `separate`
./var/spack/repos/builtin/packages/amdlibm/0001-libm-ose-Scripts-cleanup-pyc-files.patch:118:54: `existant` -> `existent`
./var/spack/repos/builtin/packages/sollya/package.py:11:23: `particularily` -> `particularly`
./var/spack/repos/builtin/packages/vtk-m/package.py:201:24: `detectes` -> `detects`
./var/spack/repos/builtin/packages/genie/package.py:25:41: `affliated` -> `affiliated`
./var/spack/repos/builtin/packages/cbtf-argonavis/package.py:36:45: `explicity` -> `explicitly`
./var/spack/repos/builtin/packages/recon/repeatmasker_recon.patch:158:24: `eles` -> `eels`
./var/spack/repos/builtin/packages/recon/repeatmasker_recon.patch:467:45: `occured` -> `occurred`
./var/spack/repos/builtin/packages/recon/repeatmasker_recon.patch:568:5: `doub` -> `doubt`
./var/spack/repos/builtin/packages/catalyst/vtkm-catalyst-pv551.patch:440:42: `paramters` -> `parameters`
./var/spack/repos/builtin/packages/of-precice/package.py:14:8: `Precice` -> `Precise`
./var/spack/repos/builtin/packages/of-precice/package.py:17:28: `precice` -> `precise`
./var/spack/repos/builtin/packages/of-precice/package.py:18:35: `precice` -> `precise`
./var/spack/repos/builtin/packages/of-precice/package.py:24:16: `precice` -> `precise`
./var/spack/repos/builtin/packages/of-precice/package.py:52:60: `precice` -> `precise`
./var/spack/repos/builtin/packages/of-precice/package.py:58:21: `precice` -> `precise`
./var/spack/repos/builtin/packages/of-precice/package.py:58:42: `precice` -> `precise`
./var/spack/repos/builtin/packages/of-precice/package.py:65:20: `precice` -> `precise`
./var/spack/repos/builtin/packages/of-precice/package.py:65:38: `precice` -> `precise`
./var/spack/repos/builtin/packages/cp2k/package.py:118:28: `consistenly` -> `consistently`
./var/spack/repos/builtin/packages/llvm-doe/package.py:336:51: `priviliges` -> `privileges`
./var/spack/repos/builtin/packages/llvm-doe/package.py:505:20: `seperated` -> `separated`
./var/spack/repos/builtin/packages/r-annotate/package.py:12:15: `enviroments` -> `environments`
./var/spack/repos/builtin/packages/gdl/package.py:68:60: `targetting` -> `targeting`
./var/spack/repos/builtin/packages/hal/package.py:34:27: `seperately` -> `separately`
./var/spack/repos/builtin/packages/sprng/package.py:43:46: `depedencies` -> `dependencies`
./var/spack/repos/builtin/packages/bazel/patch_for_fcc.patch:19:76: `overriden` -> `overridden`
./var/spack/repos/builtin/packages/bazel/patch_for_fcc.patch:29:76: `overriden` -> `overridden`
./var/spack/repos/builtin/packages/libffi/powerpc-3.3.patch:15:0: `Sicne` -> `Since`
./var/spack/repos/builtin/packages/gate/package.py:19:37: `configurate` -> `configure`
./var/spack/repos/builtin/packages/py-gitpython/package.py:24:41: `daed` -> `dead`
./var/spack/repos/builtin/packages/py-pyamg/package.py:21:57: `implicity` -> `implicitly`
./var/spack/repos/builtin/packages/rpm/package.py:37:64: `suport` -> `support`
./var/spack/repos/builtin/packages/openbabel/python-3.6-rtld-global.patch:2:37: `achive` -> `achieve`
./var/spack/repos/builtin/packages/adios2/cmake-update-findmpi.patch:512:10: `VERISON` -> `VERSION`
./var/spack/repos/builtin/packages/adios2/cmake-update-findmpi.patch:528:33: `seperation` -> `separation`
./var/spack/repos/builtin/packages/libgpg-error/awk-5.patch:46:5: `alternativly` -> `alternatively`
./var/spack/repos/builtin/packages/libjson/package.py:10:47: `dependancies` -> `dependencies`
./var/spack/repos/builtin/packages/openvdb/package.py:38:15: `neccessary` -> `necessary`
./var/spack/repos/builtin/packages/cntk/build.patch:59:56: `incldue` -> `include`
./var/spack/repos/builtin/packages/cntk/kaldireader-openblas.patch:24:56: `incldue` -> `include`
./var/spack/repos/builtin/packages/scotch/metis-headers-6.0.4.patch:61:34: `Universite` -> `Universities`
./var/spack/repos/builtin/packages/scotch/metis-headers-6.0.4.patch:161:34: `Universite` -> `Universities`
./var/spack/repos/builtin/packages/scotch/metis-headers-6.0.4.patch:267:39: `Universite` -> `Universities`
./var/spack/repos/builtin/packages/apr-util/package.py:98:16: `occassionally` -> `occasionally`
./var/spack/repos/builtin/packages/scotch/metis-headers-6.0.4.patch:370:39: `Universite` -> `Universities`
./var/spack/repos/builtin/packages/scotch/metis-headers-6.0.4.patch:466:54: `includ` -> `include`
./var/spack/repos/builtin/packages/scotch/metis-headers-6.0.4.patch:477:49: `Universite` -> `Universities`
./var/spack/repos/builtin/packages/liblbxutil/package.py:10:24: `Bandwith` -> `Bandwidth`
./var/spack/repos/builtin/packages/gasnet/package.py:66:13: `accomodate` -> `accommodate`
./var/spack/repos/builtin/packages/jhpcn-df/package.py:17:8: `occurence` -> `occurrence`
./var/spack/repos/builtin/packages/mmv/patches-as-of-mmv-1.01b-15.diff:178:8: `nto` -> `not`
./var/spack/repos/builtin/packages/mmv/patches-as-of-mmv-1.01b-15.diff:214:60: `whic` -> `which`
./var/spack/repos/builtin/packages/mmv/patches-as-of-mmv-1.01b-15.diff:265:25: `nto` -> `not`
./var/spack/repos/builtin/packages/qt/qt4-mac.patch:142:63: `architechtures` -> `architectures`
./var/spack/repos/builtin.mock/packages/patch-a-dependency/package.py:10:20: `requries` -> `requires`
./var/spack/repos/builtin.mock/packages/boost/package.py:57:52: `suport` -> `support`
./var/spack/repos/builtin.mock/packages/patch/package.py:10:20: `requries` -> `requires`
./var/spack/repos/builtin.mock/packages/cmake-client/package.py:64:60: `avaiable` -> `available`
./var/spack/repos/builtin.mock/packages/cmake-client/package.py:73:60: `avaiable` -> `available`
./var/spack/repos/builtin.mock/packages/conditionally-patch-dependency/package.py:8:34: `requries` -> `requires`
./var/spack/repos/builtin.mock/packages/cmake/package.py:25:60: `avaiable` -> `available`
./var/spack/repos/builtin.mock/packages/cmake/package.py:29:60: `avaiable` -> `available`
./var/spack/repos/builtin.mock/packages/cmake/package.py:33:60: `avaiable` -> `available`
./var/spack/repos/builtin.mock/packages/patch-several-dependencies/package.py:10:20: `requries` -> `requires`
./lib/spack/llnl/util/lock.py:550:68: `funciton` -> `function`
./lib/spack/llnl/util/tty/log.py:108:30: `exept` -> `except`
./lib/spack/llnl/util/tty/log.py:283:39: `beacuse` -> `because`
./lib/spack/llnl/util/tty/colify.py:226:42: `columsn` -> `columns`
./lib/spack/llnl/util/tty/pty.py:78:11: `Labled` -> `Labeled`
./lib/spack/llnl/util/argparsewriter.py:63:52: `relavent` -> `relevant`
./lib/spack/spack/ci.py:248:36: `garantee` -> `guarantee`
./lib/spack/spack/ci.py:1361:21: `heirarchy` -> `hierarchy`
./lib/spack/spack/filesystem_view.py:34:2: `compatability` -> `compatibility`
./lib/spack/spack/filesystem_view.py:106:8: `hierachy` -> `hierarchy`
./lib/spack/spack/filesystem_view.py:108:67: `seperately` -> `separately`
./lib/spack/spack/concretize.py:171:48: `becasue` -> `because`
./lib/spack/spack/directory_layout.py:248:51: `availabe` -> `available`
./lib/spack/spack/test/llnl/util/lock.py:636:15: `wtih` -> `with`
./lib/spack/spack/test/llnl/util/lock.py:669:33: `wtih` -> `with`
./lib/spack/spack/test/cmd/module.py:43:20: `unkown` -> `unknown`
./lib/spack/spack/test/util/spack_yaml.py:25:28: `thne` -> `then`
./lib/spack/spack/test/data/filter_file/x86_cpuid_info.c:992:34: `accomodate` -> `accommodate`
./lib/spack/spack/cmd/install.py:247:68: `explictly` -> `explicitly`
./lib/spack/spack/cmd/style.py:164:15: `ouput` -> `output`
./lib/spack/spack/cmd/create.py:261:12: `implicity` -> `implicitly`
./lib/spack/spack/cmd/create.py:427:12: `implicity` -> `implicitly`
./lib/spack/spack/cmd/help.py:71:49: `wtih` -> `with`
./lib/spack/spack/schema/packages.py:51:28: `nto` -> `not`
./lib/spack/spack/monitor.py:529:37: `verison` -> `version`
./lib/spack/spack/installer.py:76:40: `sucessfully` -> `successfully`
./lib/spack/spack/stage.py:200:4: `excpetion` -> `exception`
./lib/spack/spack/ci_optimization.py:276:33: `occurences` -> `occurrences`
./lib/spack/spack/ci_optimization.py:284:15: `occuring` -> `occurring`
./lib/spack/spack/fetch_strategy.py:493:10: `accomodate` -> `accommodate`
./lib/spack/spack/build_environment.py:1119:60: `wtih` -> `with`
./lib/spack/spack/multimethod.py:183:29: `architecutre` -> `architecture`
./lib/spack/spack/util/log_parse.py:29:27: `containig` -> `containing`
./lib/spack/spack/util/crypto.py:23:44: `algoritm` -> `algorithm`
./lib/spack/spack/util/cpus.py:13:7: `phyiscal` -> `physical`
./lib/spack/spack/util/environment.py:540:8: `Reversable` -> `Reversible`
./lib/spack/spack/util/environment.py:561:32: `reversable` -> `reversible`
./lib/spack/spack/util/module_cmd.py:62:56: `supress` -> `suppress`
./lib/spack/spack/util/module_cmd.py:198:35: `occurence` -> `occurrence`
./lib/spack/spack/util/environment.py:1022:25: `fullset` -> `fullest`
./lib/spack/spack/util/environment.py:1025:17: `fullset` -> `fullest`
./lib/spack/spack/util/environment.py:1029:25: `fullset` -> `fullest`
./lib/spack/spack/package_test.py:38:28: `Ouput` -> `Output`
./lib/spack/spack/build_systems/autotools.py:326:10: `additionaly` -> `additionally`
./lib/spack/spack/environment.py:78:24: `enviroment` -> `environment`
./lib/spack/spack/environment.py:275:45: `wtih` -> `with`
./lib/spack/spack/environment.py:325:45: `wtih` -> `with`
./lib/spack/spack/environment.py:1892:64: `witht` -> `with`
./lib/spack/spack/modules/common.py:431:20: `compatiblity` -> `compatibility`
./lib/spack/spack/spec.py:156:66: `varaints` -> `variants`
./lib/spack/docs/pipelines.rst:432:61: `succesful` -> `successful`
./lib/spack/docs/mirrors.rst:166:49: `concerte` -> `concrete`
./lib/spack/external/argparse.py:65:55: `independant` -> `independent`
./lib/spack/external/jsonschema/tests/test_exceptions.py:365:45: `overriden` -> `overridden`
./lib/spack/external/py/_io/terminalwriter.py:331:10: `Substract` -> `Subtract`
./lib/spack/external/altgraph/Graph.py:654:51: `neigbours` -> `neighbours`
./lib/spack/external/ruamel/yaml/composer.py:95:54: `occurence` -> `occurrence`
./lib/spack/external/ruamel/yaml/composer.py:97:28: `occurence` -> `occurrence`
./lib/spack/external/ruamel/yaml/emitter.py:59:26: `overriden` -> `overridden`
./lib/spack/external/ruamel/yaml/emitter.py:744:8: `preceeded` -> `preceded`
./lib/spack/external/ruamel/yaml/emitter.py:781:34: `preceeded` -> `preceded`
./lib/spack/external/ruamel/yaml/emitter.py:822:12: `preceeded` -> `preceded`
./lib/spack/external/_pytest/main.py:100:44: `compatibiltiy` -> `compatibility`
./lib/spack/external/_pytest/vendored_packages/pluggy.py:29:58: `carefuly` -> `carefully`
./lib/spack/external/_pytest/vendored_packages/pluggy.py:568:29: `explicitely` -> `explicitly`
./lib/spack/external/jinja2/sandbox.py:48:20: `attirbutes` -> `attributes`
./lib/spack/external/jinja2/sandbox.py:450:34: `apparenlty` -> `apparently`
./lib/spack/external/jinja2/compiler.py:413:20: `occour` -> `occur`
./lib/spack/external/jinja2/constants.py:19:54: `facilisi` -> `facilities`
./lib/spack/external/jinja2/constants.py:28:0: `ridiculus` -> `ridiculous`
./lib/spack/external/jinja2/ext.py:548:28: `preceeding` -> `preceding`
./lib/spack/external/jinja2/runtime.py:522:42: `anwyays` -> `anyways`
./share/spack/docker/entrypoint.bash:80:26: `psuedo` -> `pseudo`
./share/spack/setup-env.fish:230:55: `seperated` -> `separated`
./share/spack/setup-env.fish:291:55: `seperated` -> `separated`
./share/spack/gitlab/cloud_pipelines/stacks/e4s/spack.yaml:262:6: `precice` -> `precise`
./share/spack/setup-env.fish:334:55: `seperated` -> `separated`
./share/spack/gitlab/cloud_pipelines/stacks/e4s/spack.yaml:339:10: `precice` -> `precise`
./share/spack/setup-env.fish:585:9: `temprary` -> `temporary`
./share/spack/setup-env.fish:629:59: `seperated` -> `separated`
vsoch commented 3 years ago

Fixing hashes would also work! I was trying both of these:

typos ./lib/spack/spack --exclude ./lib/spack/spack/test
typos --exclude ./lib/spack/spack/test ./lib/spack/spack 

and it didn't seem to work. Why is the -- needed, especially if I can just do:

typos ./lib/spack/spack/
epage commented 3 years ago

The -- was to tell cargo run to pass all args after -- to the tool it was running (since I was running directly from source rather than a pre-built binary).

Changing

cargo run --manifest-path ../typos/Cargo.toml -- --exclude ./lib/spack/spack/test/ ./lib/spack/spack/ ./lib/spack/docs/ --format brief

to

cargo run --manifest-path ../typos/Cargo.toml -- --exclude ./lib/spack/spack/test/ ./lib/spack/spack/ ./lib/spack/docs/ --format brief ./lib/spack/spack/

Starts reproducing the behavior. I think what is happening is we are running with ./lib/spack/spack/ being treated as the root directory for evaluating ./lib/spack/spack/test/, so its effectively looking for ./lib/spack/spack/lib/spack/spack/test

I think this will also be a problem for excluding via the config file, that we aren't treating the config file's parent directory as the directory to evaluate patterns from.

A workaround for this is if you --exclude test. That pattern will match even once we fix what directory is being treated as the root for evaluating patterns.

vsoch commented 3 years ago

Ah gotcha, that makes sense.

epage commented 3 years ago

So I'm calling

            let mut overrides = ignore::overrides::OverrideBuilder::new(".");

Which according to https://docs.rs/ignore/0.4.17/ignore/overrides/struct.OverrideBuilder.html means that excludes should be relative to the CWD (granted, for excludes from the config, we should be choosing the config's path).

So going to have to debug into this to figure out why the excludes weren't relative to the CWD afterall

epage commented 3 years ago

Ok., so my original post had a mistake in it from when I modified the arguments you were passing in.

spack on  develop 
❯ cargo run --manifest-path ../typos/Cargo.toml -- --exclude ./lib/spack/spack/test --exclude external --exclude var/spack/repos/ --format brief | sort | rg test
    Finished dev [unoptimized + debuginfo] target(s) in 0.07s
     Running `/home/epage/src/personal/typos/target/debug/typos --exclude ./lib/spack/spack/test --exclude external --exclude var/spack/repos/ --format brief`
./lib/spack/spack/package_test.py:38:28: `Ouput` -> `Output`
./lib/spack/spack/test/cmd/module.py:43:20: `unkown` -> `unknown`
./lib/spack/spack/test/data/filter_file/x86_cpuid_info.c:992:34: `accomodate` -> `accommodate`
./lib/spack/spack/test/llnl/util/lock.py:636:15: `wtih` -> `with`
./lib/spack/spack/test/llnl/util/lock.py:669:33: `wtih` -> `with`
./lib/spack/spack/test/util/spack_yaml.py:25:28: `thne` -> `then`

spack on  develop 
❯ cargo run --manifest-path ../typos/Cargo.toml -- --exclude lib/spack/spack/test --exclude external --exclude var/spack/repos/ --format brief lib | sort | rg test
    Finished dev [unoptimized + debuginfo] target(s) in 0.06s
     Running `/home/epage/src/personal/typos/target/debug/typos --exclude lib/spack/spack/test --exclude external --exclude var/spack/repos/ --format brief lib`
lib/spack/spack/package_test.py:38:28: `Ouput` -> `Output`

It looks like gitignore (which is the glob style expected for --exclude doesn't like a leading ./

So this seems to be more of a documentation issue to clarify how --exclude is expected to work (but we are still setting the path wrong for config file excludes)