Skip to content

Conversation

@juleswritescode
Copy link
Collaborator

I tried adding a new lint rule, but the just gen-lint script fails:

Screenshot 2025-02-09 at 09 46 28

I can't see a syntax error in this statement:
alter table users alter column email drop not null;

so maybe something is broken?

Here's an example of how the documentation could look like:

```rust
````rust
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will check this, too – my local prettier adds an extra ` for rust

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, this is actually makes sense, because there are triple backticks within the code block. 👍

@juleswritescode juleswritescode changed the title feat(analyser): banDropNotNull rule [wip] feat(analyser): banDropNotNull rule Feb 9, 2025
@psteinroe
Copy link
Collaborator

Thanks for working through the guide! I will check what's wrong. We should also add a test framework (like biome) to quickly run the rules over a set of sql files and compare expected results. 🙏🏼

@psteinroe
Copy link
Collaborator

This could even be an issue in the statement splitter 😅 it seems like we are cutting the statement too early.

@juleswritescode
Copy link
Collaborator Author

juleswritescode commented Feb 9, 2025

This could even be an issue in the statement splitter 😅 it seems like we are cutting the statement too early.

Ah just realized we're currently ignoring the banDropColumn sql. That's why it worked with the existing rule :)

I'll just ignore the SQL block in the new rule for now.

@juleswritescode
Copy link
Collaborator Author

juleswritescode commented Feb 9, 2025

Thanks for working through the guide! I will check what's wrong. We should also add a test framework (like biome) to quickly run the rules over a set of sql files and compare expected results. 🙏🏼

100%, I can make that my next priority :) 👍

@juleswritescode juleswritescode marked this pull request as ready for review February 9, 2025 17:30
@juleswritescode juleswritescode changed the title [wip] feat(analyser): banDropNotNull rule feat(analyser): banDropNotNull rule Feb 9, 2025
Copy link
Collaborator

@psteinroe psteinroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@psteinroe psteinroe merged commit 31cbb5d into main Feb 10, 2025
6 checks passed
@juleswritescode juleswritescode deleted the feat/analyser-ban-drop-not-null branch October 28, 2025 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants