Apply linter only on migrations after specific version
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
Research direction
Start at the CLI entry point for squawk ./migrations and trace how migration filenames are discovered and linted. Add support for a version threshold so files numbered below it are skipped, then verify that the example command checks only migrations from version 2 onward. Add or update tests for the filtering behavior.
Written by the indexing model from the issue text.
Description
I'd like to exclude old .sql files from the linter check to integrate it in our pipeline. The reason being that I want to fail the build if squawk complains, but I don't want to touch the older migration files since the system is in production atm. Is there any way to do this atm or does it require a new feature implementation?
fwiw, the migrations folder looks like this (which I believe it is pretty standard):
./migrations/
/0001_main_table.up.sql
/0001_main_table.down.sql
/0002_new_table.up.sql
/0002_new_table.up.sql
/0003_add_param_new_table.up.sql
/0003_add_param_new_table.down.sql
And I'd like to have a catch all command that would only check the migrations after a certain version, e.g. $ squawk ./migrations ---from-version 2, which would lint the migration files 0002_* and 0003_* only.
This could also be accomplished by adding a degree of indirection by calling a bash script that calls squawk explicitly for each file in the migrations folder after a certain version. However, I think this would be a neat feature to include natively.
- Dominant language
- Rust
- Stars
- 1.2k
- Forks
- 70
- Avg merge
- 52m
- Merged PRs (30d)
- 47
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sbdchd/squawk
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 58/100
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 56/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100