diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..aa5188e --- /dev/null +++ b/.codespellrc @@ -0,0 +1,13 @@ +[codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +# assets/database/licenses and database_keywords.json hold verbatim SPDX +# license texts (incl. non-English ones); processor/constants.go embeds them +skip = .git,.git-meta,.gitignore,.gitattributes,.*cache,go.sum,vendor,*.lock,.codespellrc,./assets/database/licenses,./database_keywords.json,./processor/constants.go +check-hidden = true +# ignore-regex = +ignore-words-list = + # loop variable for a license text in processor/detector_license.go + te, + # verbatim typo in honk's license text, used as a test fixture (raw string) + # in pkg/license_test.go + dependenices diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000..9458b0c --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,23 @@ +# 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@v6 + - name: Codespell + uses: codespell-project/actions-codespell@8f01853be192eb0f849a5c7d721450e7a467c579 # v2.2 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c8bdae2..d8304a0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,7 +14,7 @@ * Before submitting, please specify that you explicitly licence your contribution under MIT License AND UNLICENSE. -* If you include compatible code from a third party souce with an altunate license please add a SDPX tag to indicate this, see https://github.com/boyter/lc/blob/master/parsers/helpers.go bytesToHuman function as a reference exmaple. +* If you include compatible code from a third party source with an alternate license please add a SPDX tag to indicate this, see https://github.com/boyter/lc/blob/master/parsers/helpers.go bytesToHuman function as a reference example. #### **Always remember** diff --git a/NOTES.md b/NOTES.md index 6c52930..2b83387 100644 --- a/NOTES.md +++ b/NOTES.md @@ -27,7 +27,7 @@ could have multiple licenses in them. Example github.com/valkey/valkey/COPYING ".html", ".txt", -Where the file matchs the above patterns, where it has has no extention or +Where the file matches the above patterns, where it has no extension or one of the others we should inspect it to see if it has a license. Its possible a licence exists here, but we cannot be sure. Note that its possible there are multiple licences in the file which needs to be dealt with. diff --git a/README.md b/README.md index b65e11b..961320e 100644 --- a/README.md +++ b/README.md @@ -79,9 +79,9 @@ GLOBAL OPTIONS: --confidence 0.95, -c 0.95 Set required confidence level for licence matching between 0 and 1 E.G. 0.95 (default: "0.85") --deepguess true, --dg true Should attempt to deep guess the licence false or true true (default: "true") --filesize 50000, --fs 50000 How large a file in bytes should be processed 50000 (default: "50000") - --licensefiles copying,readme, --lf copying,readme Possible license files to inspect for over-arching license as comma seperated list copying,readme (default: "license,licence,copying,readme") - --pathblacklist .git,.hg,.svn, --pbl .git,.hg,.svn Which directories should be ignored as comma seperated list .git,.hg,.svn (default: ".git,.hg,.svn") - --extblacklist gif,jpg,png, --xbl gif,jpg,png Which file extensions should be ignored for deep analysis as comma seperated list E.G. gif,jpg,png (default: "woff,eot,cur,dm,xpm,emz,db,scc,idx, + --licensefiles copying,readme, --lf copying,readme Possible license files to inspect for over-arching license as comma separated list copying,readme (default: "license,licence,copying,readme") + --pathblacklist .git,.hg,.svn, --pbl .git,.hg,.svn Which directories should be ignored as comma separated list .git,.hg,.svn (default: ".git,.hg,.svn") + --extblacklist gif,jpg,png, --xbl gif,jpg,png Which file extensions should be ignored for deep analysis as comma separated list E.G. gif,jpg,png (default: "woff,eot,cur,dm,xpm,emz,db,scc,idx, mpp,dot,pspimage,stl,dml,wmf,rvm,resources,tlb,docx,doc,xls,xlsx,ppt,pptx,msg,vsd,chm,fm,book,dgn,blines,cab,lib,obj,jar,pdb,dll,bin,out,elf,so,msi,nupkg,pyc,ttf,woff2,jpg,jpeg,png,gif,bmp,psd,tif,tif f,yuv,ico,xls,xlsx,pdb,pdf,apk,com,exe,bz2,7z,tgz,rar,gz,zip,zipx,tar,rpm,bin,dmg,iso,vcd,mp3,flac,wma,wav,mid,m4a,3gp,flv,mov,mp4,mpg,rm,wmv,avi,m4v,sqlite,class,rlib,ncb,suo,opt,o,os,pch,pbm,pnm,ppm ,pyd,pyo,raw,uyv,uyvy,xlsm,swf") @@ -179,7 +179,7 @@ Directory File License Confide ### SPDX -The ouput of SPDX is a valid SPDX 2.1 document. Validation was checked against the tools supplied by the SPDX group. +The output of SPDX is a valid SPDX 2.1 document. Validation was checked against the tools supplied by the SPDX group. Running master against itself to produce a SPDX and the validating using the tools from https://github.com/spdx/tools ``` @@ -236,7 +236,7 @@ Rank Open Source License % * Add error handling for all the file operations and just in general. Most are currently ignored * Add logic to guess the file type for SPDX value FileType -* Add addtional unit and integration tests +* Add additional unit and integration tests * Investigate using "github.com/gosuri/uitable" for formatting https://github.com/gosuri/uitable * https://web.archive.org/web/20180822173147/https://blog.sourced.tech/post/gld/ * https://github.com/boyter/boyter.org/blob/01601a2cafc2b2788b29b6943ad45ad40316d9a8/content/posts/improving-lc-performance.md diff --git a/assets/database/README.md b/assets/database/README.md index 973c1fe..41b88be 100644 --- a/assets/database/README.md +++ b/assets/database/README.md @@ -59,4 +59,4 @@ indicates that it could be one of the above. Alturnate idea, pick one of them to be the defacto version for that. So in the case of GPL-3.0 go with GPL-3.0 because -that seems like a resonable guess. Should resolve it for most of them. +that seems like a reasonable guess. Should resolve it for most of them. diff --git a/lc.go b/lc.go index 13f0bb9..555a761 100644 --- a/lc.go +++ b/lc.go @@ -43,12 +43,12 @@ package main // cli.StringFlag{ // Name: "licensefiles, lf", // Usage: "Possible license files to inspect for over-arching license as comma separated list `copying,readme`", -// Value: "license,licence,lisence,lisense,copying,readme,legal,copyright,copyleft,gpl,bsd,mit,apache,unlicense,unlicence", +// Value: "license,licence,lisence,lisense,copying,readme,legal,copyright,copyleft,gpl,bsd,mit,apache,unlicense,unlicence", // codespell:ignore lisence,lisense // Destination: &parsers.PossibleLicenceFiles, // }, // cli.StringFlag{ // Name: "pathblacklist, pbl", -// Usage: "Which directories should be ignored as comma seperated list `.git,.hg,.svn`", +// Usage: "Which directories should be ignored as comma separated list `.git,.hg,.svn`", // Value: ".git,.hg,.svn", // Destination: &parsers.PathBlacklist, // }, diff --git a/what-we-look-at.md b/what-we-look-at.md index 731e27d..22246fc 100644 --- a/what-we-look-at.md +++ b/what-we-look-at.md @@ -35,7 +35,7 @@ For individual files the file is scanned in the same way but in addition is scan Which will take precedence over any fuzzy matching. The indicators must match known SPDX licenses or they will be disregarded. -When finished the license determined is based on the SDPX identifiers if present, fuzzy matching if over the confidence value and then the root license(s). If multiples match they are treated as an `AND`. +When finished the license determined is based on the SPDX identifiers if present, fuzzy matching if over the confidence value and then the root license(s). If multiples match they are treated as an `AND`. Take for example,