Skip to content

Commit ce63043

Browse files
dguidoclaude
andcommitted
feat: add pre-commit hooks and run comprehensive tests always
- Remove label requirement for comprehensive tests (only 3 min runtime) - Add pre-commit configuration with ruff and basic checks - Fix all formatting issues found by pre-commit - Update development setup docs to include pre-commit installation - Prevents CI failures from formatting issues 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent d5a8fdb commit ce63043

21 files changed

+109
-84
lines changed
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
1-
---
2-
body:
3-
-
4-
attributes:
1+
---
2+
body:
3+
-
4+
attributes:
55
value: |
66
Please check the issues tab to avoid duplicates.
77
Thanks for taking the time to fill out this bug report!
88
type: markdown
9-
-
10-
attributes:
9+
-
10+
attributes:
1111
label: "Describe the issue:"
1212
id: what-happened
1313
type: textarea
14-
validations:
14+
validations:
1515
required: true
16-
-
17-
attributes:
16+
-
17+
attributes:
1818
description: "It can be a github repo, etherscan link, or code snippet."
1919
label: "Code example to reproduce the issue:"
2020
placeholder: "`contract A {}`\n"
2121
id: reproduce
2222
type: textarea
23-
validations:
23+
validations:
2424
required: true
25-
-
26-
attributes:
25+
-
26+
attributes:
2727
description: |
28-
What version of solc-select are you running?
28+
What version of solc-select are you running?
2929
Run `solc-select--version`
3030
label: "Version:"
3131
id: version
3232
type: textarea
33-
validations:
33+
validations:
3434
required: true
35-
-
36-
attributes:
35+
-
36+
attributes:
3737
description: |
38-
Please copy and paste any relevant log output. This
38+
Please copy and paste any relevant log output. This
3939
will be automatically formatted into code, so no need for backticks.
4040
render: shell
4141
label: "Relevant log output:"
4242
id: logs
4343
type: textarea
4444
description: "File a bug report"
45-
labels:
45+
labels:
4646
- bug-candidate
4747
name: "Bug Report"
4848
title: "[Bug-Candidate]: "

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ updates:
55
directory: /
66
schedule:
77
interval: daily
8-
8+
99
- package-ecosystem: pip
1010
directory: /
1111
schedule:

.github/workflows/ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,9 @@ jobs:
4747
# Run pytest with appropriate platform markers
4848
# Skip slow tests (upgrade test) and version_boundaries tests in CI
4949
python -m pytest tests/ -v --tb=short -k "not version_boundaries" -m "not slow"
50-
50+
5151
comprehensive-tests:
5252
name: Comprehensive Tests (Python ${{ matrix.python }} on ${{ matrix.os }})
53-
# Only run on schedule or when labeled 'full-tests'
54-
if: github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'full-tests')
5553
runs-on: ${{ matrix.os }}
5654
strategy:
5755
matrix:

.github/workflows/pip-audit.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,3 @@ jobs:
3838
uses: pypa/[email protected]
3939
with:
4040
virtual-environment: /tmp/pip-audit-env
41-

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ global-version
88
build/
99
dist/
1010
*.egg
11-
*.egg-info/
11+
*.egg-info/

.pre-commit-config.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Pre-commit hooks for code quality
2+
# See https://pre-commit.com for more information
3+
repos:
4+
- repo: https://github.com/astral-sh/ruff-pre-commit
5+
# Ruff version should match the version in pyproject.toml
6+
rev: v0.8.4
7+
hooks:
8+
# Run the linter
9+
- id: ruff
10+
args: ["--fix"]
11+
# Run the formatter
12+
- id: ruff-format
13+
14+
- repo: https://github.com/pre-commit/pre-commit-hooks
15+
rev: v5.0.0
16+
hooks:
17+
- id: trailing-whitespace
18+
- id: end-of-file-fixer
19+
- id: check-yaml
20+
- id: check-added-large-files
21+
args: ["--maxkb=1000"]
22+
- id: check-merge-conflict
23+
- id: check-toml
24+
- id: debug-statements

CONTRIBUTING.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# Contributing to solc-select
1+
# Contributing to solc-select
22

3-
Hi! Welcome to solc-select.
3+
Hi! Welcome to solc-select.
44

5-
## Bug Reports and Feature Suggestions
5+
## Bug Reports and Feature Suggestions
66

77
Bug reports and feature suggestions can be submitted to our issue tracker. For bug reports, attaching the contract that caused the bug will help us in debugging and resolving the issue quickly. If you find a security vulnerability, do not open an issue; email [email protected] instead.
88

99
## Questions
1010
Questions can be submitted to the issue tracker, but you may get a faster response if you ask in our [chat room](https://slack.empirehacking.nyc/) (in the #ethereum channel).
1111

12-
## Code
12+
## Code
1313
solc-select uses the pull request contribution model. Please make an account on Github, fork this repo, and submit code contributions via pull request. For more documentation, look [here](https://guides.github.com/activities/forking/).
1414

1515
Some pull request guidelines:
@@ -31,7 +31,8 @@ git clone https://github.com/crytic/solc-select.git
3131
cd solc-select
3232
uv venv
3333
source .venv/bin/activate # On Windows: .venv\Scripts\activate
34-
uv pip install -e .
34+
uv pip install -e ".[dev]"
35+
pre-commit install # Set up automatic linting on commit
3536
```
3637

3738
#### Using pip
@@ -41,7 +42,8 @@ git clone https://github.com/crytic/solc-select.git
4142
cd solc-select
4243
python3 -m venv venv
4344
source venv/bin/activate # On Windows: venv\Scripts\activate
44-
pip install -e .
45+
pip install -e ".[dev]"
46+
pre-commit install # Set up automatic linting on commit
4547
```
4648

4749
#### Using make

ISSUE_DRAFT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,4 @@ The solution should be tested on:
128128

129129
- [Solidity Official Binaries Repository](https://binaries.soliditylang.org/)
130130
- [macOS Universal Binary Support (v0.8.24+)](https://github.com/ethereum/solidity/issues/12291#issuecomment-2223328961)
131-
- [solc-js npm package](https://www.npmjs.com/package/solc) - JavaScript/WASM version
131+
- [solc-js npm package](https://www.npmjs.com/package/solc) - JavaScript/WASM version

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,4 +658,4 @@ specific requirements.
658658
You should also get your employer (if you work as a programmer) or school,
659659
if any, to sign a "copyright disclaimer" for the program, if necessary.
660660
For more information on this, and how to apply and follow the GNU AGPL, see
661-
<https://www.gnu.org/licenses/>.
661+
<https://www.gnu.org/licenses/>.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
dev:
1+
dev:
22
python3 -m venv env && source ./env/bin/activate
33
python3 -m pip install -e .

0 commit comments

Comments
 (0)