Skip to content

Commit ca9dd8c

Browse files
committed
Add pre-commit to run standard hooks plus codespell
1 parent 6dc4d2f commit ca9dd8c

13 files changed

Lines changed: 200 additions & 142 deletions

File tree

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
* text=auto eol=lf
2-
dist/** -diff linguist-generated=true
2+
dist/** -diff linguist-generated=true

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @dhavalgojiya
1+
* @dhavalgojiya

.github/workflows/ci-test.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,18 @@ on:
77
branches: [ "main" ]
88

99
jobs:
10+
# -----------------
11+
# Job 1: Pre-commit
12+
# -----------------
13+
pre-commit:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v6
17+
- uses: pre-commit/[email protected]
18+
- uses: pre-commit-ci/[email protected]
19+
if: always()
1020
# -----------------------------
11-
# Job 1: Package Checks & Build
21+
# Job 2: Package Checks & Build
1222
# -----------------------------
1323
package:
1424
runs-on: ubuntu-latest
@@ -90,7 +100,7 @@ jobs:
90100
run: |
91101
echo "Pinging Solr Core: ${SOLR_CORE}"
92102
RESPONSE=$(curl -s --fail "http://127.0.0.1:8983/solr/${SOLR_CORE}/admin/ping?wt=json")
93-
103+
94104
if echo "$RESPONSE" | grep -q '"status":"OK"'; then
95105
echo "🎉 Solr is healthy and responding"
96106
else

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,4 @@ out
112112
.yarn/unplugged
113113
.yarn/build-state.yml
114114
.yarn/install-state.gz
115-
.pnp.*
115+
.pnp.*

.pre-commit-config.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Learn more about this config here: https://pre-commit.com/
2+
3+
# To enable these pre-commit hooks run:
4+
# `pipx install pre-commit` or `brew install pre-commit`
5+
# Then in the project root directory run `pre-commit install`
6+
7+
exclude: dist/
8+
9+
repos:
10+
- repo: https://github.com/pre-commit/pre-commit-hooks
11+
rev: v6.0.0
12+
hooks:
13+
- id: check-added-large-files
14+
- id: check-case-conflict
15+
- id: check-docstring-first
16+
- id: check-executables-have-shebangs
17+
- id: check-illegal-windows-names
18+
- id: check-json
19+
- id: check-merge-conflict
20+
- id: check-shebang-scripts-are-executable
21+
- id: check-symlinks
22+
- id: check-toml
23+
- id: check-vcs-permalinks
24+
- id: check-xml
25+
- id: check-yaml
26+
- id: destroyed-symlinks
27+
- id: detect-aws-credentials
28+
args:
29+
- --allow-missing-credentials
30+
- id: detect-private-key
31+
- id: end-of-file-fixer
32+
- id: file-contents-sorter
33+
- id: forbid-new-submodules
34+
- id: forbid-submodules
35+
- id: mixed-line-ending
36+
args:
37+
- --fix=lf
38+
- id: sort-simple-yaml
39+
- id: trailing-whitespace
40+
41+
- repo: https://github.com/codespell-project/codespell
42+
rev: v2.4.1
43+
hooks:
44+
- id: codespell
45+
args:
46+
- --ignore-words-list=nd
47+
additional_dependencies:
48+
- tomli

CODE_OF_CONDUCT.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ Community Moderators take reports of violations seriously and will make every ef
5151

5252
If an investigation by the Community Moderators finds that this Code of Conduct has been violated, the following enforcement ladder may be used to determine how best to repair harm, based on the incident’s impact on the individuals involved and the community as a whole. Depending on the severity of a violation, lower rungs on the ladder may be skipped.
5353

54-
1. **Warning**
55-
Event: A violation involving a single incident or series of actions.
54+
1. **Warning**
55+
Event: A violation involving a single incident or series of actions.
5656
Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
5757

58-
2. **Temporary Ban**
59-
Event: A violation involving a series of actions or a single serious incident.
58+
2. **Temporary Ban**
59+
Event: A violation involving a series of actions or a single serious incident.
6060
Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
6161

62-
3. **Permanent Ban**
63-
Event: A pattern of repeated code of conduct violations that other steps on the ladder have failed to resolve, or a violation so serious that the Community Moderators determine there is no way to keep the community safe with this person as a member.
64-
Consequence: Access to all community spaces, tools, and communication channels is removed. In general, permanent bans should be rarely used, should have strong reasoning behind them, and should only be resorted to if working through other remedies has failed to change the behavior.
62+
3. **Permanent Ban**
63+
Event: A pattern of repeated code of conduct violations that other steps on the ladder have failed to resolve, or a violation so serious that the Community Moderators determine there is no way to keep the community safe with this person as a member.
64+
Consequence: Access to all community spaces, tools, and communication channels is removed. In general, permanent bans should be rarely used, should have strong reasoning behind them, and should only be resorted to if working through other remedies has failed to change the behavior.
6565
Repair: There is no possible repair in cases of this severity.
6666

6767
This enforcement ladder is intended as a guideline. It does not limit the ability of Community Managers to use their discretion and judgment, in keeping with the best interests of our community.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<img src="https://raw.githubusercontent.com/DhavalGojiya/setup-solr-action/main/assets/images/project-logo.png" width="90%" alt="Project Apache Solr Logo"/>
55
</p>
66

7-
Easily spin up an [Apache Solr](https://solr.apache.org/) instance inside your **GitHub Actions CI** pipeline.
7+
Easily spin up an [Apache Solr](https://solr.apache.org/) instance inside your **GitHub Actions CI** pipeline.
88
This action makes it simple to provision Solr during your tests or builds, without needing complex manual setup.
99

1010
It will:
@@ -223,14 +223,14 @@ This will simulate your workflow on your local machine using [act](https://githu
223223

224224
## 🤝 Contributing
225225

226-
Want to improve this project? Contributions are welcome!
226+
Want to improve this project? Contributions are welcome!
227227
Please check out the [Contributing Guide](./CONTRIBUTING.md) for details.
228228

229229
---
230230

231231
## 👨‍💻 About the Author
232232

233-
Hi, I’m **Dhaval Gojiya** — a passionate **Software Engineer** and also a **Farmer** 🌱.
233+
Hi, I’m **Dhaval Gojiya** — a passionate **Software Engineer** and also a **Farmer** 🌱.
234234
I love building open-source tools that simplify workflows, while staying curious and grounded in both tech and nature.
235235

236236
---

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@
2727
"tsup": "^8.5.0",
2828
"typescript": "^5.9.2"
2929
}
30-
}
30+
}

src/scripts/setup-solr.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)