antfu / case-police Goto Github PK
View Code? Open in Web Editor NEWπ¨ Make the case correct, PLEASE!
License: MIT License
π¨ Make the case correct, PLEASE!
License: MIT License
We currently have a Vale workflow hooked up to our docs repo.
I'd love to utilize Case Police w/in that same workflow, but as it stands I think the best we'd get is two separate checks (with the Case Police integrated through GitHub actions).
Realize I'm just suggesting a bunch of work that y'all could do to save myself the trouble... but any thoughts on adding a Vale Package for Case Police?
I'd love to be able to hook into the stuff y'all already keep maintained but then pull into our current Vale workflow.
At the moment, it ends up being a process a lot more like cloudflare/cloudflare-docs#16564 or https://github.com/DataDog/datadog-vale/blob/main/styles/SIEM-Names/namecase.yml.
I'd guess some customization would definitely continue regardless, but y'alls list would be a great starting point (especially if it were made available in more places).
No response
No response
Would love to contribute to one if it does not exist. :)
empty
No response
No response
RESPONSE=$(curl -sSL -H "${AUTH_HEADER}" -H "${HEADER}" --user "${GITHUB_ACTOR}" -X GET --data "${DATA}" ${PULLS_URL})
case-police tells me that sSL
should be SSL
though this is a curl shorthand rather than a word
https://stackblitz.com/edit/vitejs-vite-5bjczq?file=run.sh
System:
OS: Linux 5.15 Ubuntu 20.04.4 LTS (Focal Fossa)
CPU: (16) x64 AMD EPYC 7B13
Memory: 19.95 GB / 62.81 GB
Container: Yes
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
Yarn: 1.22.17 - ~/.nvm/versions/node/v16.16.0/bin/yarn
npm: 8.11.0 - ~/.nvm/versions/node/v16.16.0/bin/npm
yarn
For example, the following file:
Romania (RomΓ’nia)
Cause this output:
Case Police v0.3.0
1475 files found for checking
Rom β ROM ./file
For example, brands.json, applications.json so that we can choose that field we want to fix with CLIπ
how to do this when i only want to check some independent file or directory
some words like webpack allow using 'Webpack' at the beginning of sentence, is there a way to allow this?
https://stackblitz.com/edit/node-essghk?file=package.json
System:
OS: macOS 12.5.1
CPU: (10) arm64 Apple M1 Pro
Memory: 114.20 MB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.19.0 - ~/Library/Caches/fnm_multishells/89917_1677131463820/bin/node
Yarn: 1.11.1 - ~/Library/Caches/fnm_multishells/89917_1677131463820/bin/yarn
npm: 8.19.3 - ~/Library/Caches/fnm_multishells/89917_1677131463820/bin/npm
Browsers:
Chrome: 110.0.5481.100
Firefox Developer Edition: 111.0
Safari: 15.6.1
npm
Would love to contribute to one if it does not exist. :)
case-police
flags NATs
as incorrect, I'm trying to describe the plural of a Network Address Translator
Lint a file with NATs
in it
System:
OS: macOS 12.5
CPU: (10) arm64 Apple M1 Max
Memory: 14.20 GB / 64.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.7.0 - ~/.volta/tools/image/node/18.7.0/bin/node
Yarn: 1.22.18 - ~/.volta/tools/image/yarn/1.22.18/bin/yarn
npm: 8.17.0 - ~/.volta/tools/image/npm/8.17.0/bin/npm
Browsers:
Firefox: 103.0.2
Safari: 15.6
npm
Thinking about this rule:
case-police
will only fix words that have both lowercase and uppercase letters, it WON'T convert java
to Java
. If correct form is a single capitalized word, there is no need to add it to the dictionary., is that means if I have a entry:
{
// ...
"eslint": "ESLint"
// ...
}
, case-police
will not change eslint
to ESLint
?
But eslint
have already in dict.json, is this guidelines express with confusing?
I'd love to use this for personal projects and for work to match and fix domain-specific terms.
npx case-police --append my-terms.json --fix
Example: misspelling of VS Code, where word after space is not correctly cased.
text.txt
VS code
Output: All good, well done!
Expected: test.txt:0 VS code -> VS Code
If you add rules as :
{
"abc" : "Abc",
"abc.def":"Abc.Def"
}
then
abc.def
Abc.def
AbC.DeF
AbC
will match as :
AbC β Abc
AbC β Abc
but if you add them as :
{
"abc.def":"Abc.Def",
"abc" : "Abc"
}
then the same text
abc.def
Abc.def
AbC.DeF
AbC
will match as :
Abc.def β Abc.Def
AbC.DeF β Abc.Def
AbC β Abc
A fix could be to sort the keys by size (to have the "closest" match first)
https://stackblitz.com/edit/stackblitz-starters-zc8y2r?file=test.md
System:
OS: Linux 5.15 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
CPU: (12) x64 12th Gen Intel(R) Core(TM) i7-1255U
Memory: 12.17 GB / 15.62 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 16.20.1 - /usr/local/bin/node
npm: 8.19.4 - /usr/local/bin/npm
pnpm: 8.9.2 - /mnt/c/Dev/ArmoniK/ArmoniK.Community/node_modules/.bin/pnpm
pnpm
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.