Skip to content

Commit

Permalink
removed husky
Browse files Browse the repository at this point in the history
  • Loading branch information
dbale-altoros committed Dec 19, 2024
1 parent 4187878 commit eb3098a
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 51 deletions.
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

8 changes: 8 additions & 0 deletions DEV-README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Setting up Git Hooks

After cloning the repository, set up the pre-commit hook by running the following commands:

```sh
touch .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
echo '#!/bin/sh\nnode scripts/check-changes.js' > .git/hooks/pre-commit
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ Or disable all validations for a group of lines:
### Style Guide Rules
[Full list with all supported Style Guide Rules](docs/rules.md#style-guide-rules)
### Best Practices Rules
[Full list with all supported Best Practices Rules](docs/rules.md#best-practise-rules)
[Full list with all supported Best Practices Rules](docs/rules.md#best-practices-rules)

## Docker
### Solhint has an official Docker Image
Expand Down Expand Up @@ -269,7 +269,7 @@ Related documentation you may find [here](https://protofire.github.io/solhint/).
The Solidity parser used is [`@solidity-parser/parser`](https://github.com/solidity-parser/parser).

## Licence
## License

MIT

Expand Down
40 changes: 9 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@
"/solhint.js"
],
"author": "Ilya Drabenia <ilya.drobenya@gmail.com>",
"contributors": ["Diego Bale <diego.bale@protofire.io>"],
"contributors": [
"Diego Bale <diego.bale@protofire.io>"
],
"license": "MIT",
"dependencies": {
"@solidity-parser/parser": "^0.18.0",
"@solidity-parser/parser": "^0.19.0",
"ajv": "^6.12.6",
"antlr4": "^4.13.1-patch-1",
"ast-parents": "^0.0.1",
Expand All @@ -64,7 +66,6 @@
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.3",
"markdown-table": "^2.0.0",
"mocha": "^10.2.0",
"mocha-lcov-reporter": "^1.3.0",
Expand Down
26 changes: 26 additions & 0 deletions scripts/check-changes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const { execSync } = require('child_process');

function changed() {
try {
// Run Git commands to check for changes in the lib/rules directory
const diffIndex = execSync('git diff-index --name-only -B -R -M -C HEAD lib/rules').toString().trim();
const lsFiles = execSync('git ls-files -t -o -m lib/rules').toString().trim();

// Return true if there are changes
return diffIndex !== '' || lsFiles !== '';
} catch (error) {
console.error('Error checking for changes:', error);
return false;
}
}

if (changed()) {
try {
// Run npm commands if there are changes
execSync('npm run generate-rulesets', { stdio: 'inherit' });
execSync('npm run docs', { stdio: 'inherit' });
} catch (error) {
console.error('Error running npm commands:', error);
process.exit(1);
}
}
11 changes: 0 additions & 11 deletions scripts/generate-changed.sh

This file was deleted.

0 comments on commit eb3098a

Please sign in to comment.