Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex warnings at runtime #48

Closed
ghiculescu opened this issue Sep 12, 2024 · 4 comments
Closed

Regex warnings at runtime #48

ghiculescu opened this issue Sep 12, 2024 · 4 comments

Comments

@ghiculescu
Copy link
Contributor

These warnings are reported at runtime, when running tests:

lib/activerecord-clean-db-structure/clean_dump.rb:39: warning: character class has duplicated range: /^-- (.*); Schema: ([\w_\.]+|-); Owner: -.*/
lib/activerecord-clean-db-structure/clean_dump.rb:50: warning: character class has duplicated range
lib/activerecord-clean-db-structure/clean_dump.rb:51: warning: character class has duplicated range
lib/activerecord-clean-db-structure/clean_dump.rb:62: warning: character class has duplicated range
lib/activerecord-clean-db-structure/clean_dump.rb:79: warning: character class has duplicated range: /ALTER TABLE ONLY [\w_\.]+ ATTACH PARTITION
lib/activerecord-clean-db-structure/clean_dump.rb:83: warning: character class has duplicated range
lib/activerecord-clean-db-structure/clean_dump.rb:107: warning: character class has duplicated range: /CREATE INDEX ([\w_]+) ON ONLY/

I'm pretty dumb with regexes so don't know if they're valid warnings or not.

andyatkinson added a commit to andyatkinson/activerecord-clean-db-structure that referenced this issue Sep 15, 2024
Apparently the \w regexp character already includes the underscore, so
the underscore is redundant, generating the warnings.

The fix was to remove the underscore. It would be nice to verify this
manually on a structure dump with some of the statements that related to
waht's modified here.
@andyatkinson
Copy link
Collaborator

@ghiculescu WDYT?
#49

@andyatkinson
Copy link
Collaborator

Fixed by #49

@andyatkinson
Copy link
Collaborator

@ghiculescu v0.4.3 was released. If you're able to install that version and respond back with any usage reports, that would be great. Thanks!

@ghiculescu
Copy link
Contributor Author

Yep we are good here 👍

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

No branches or pull requests

2 participants