-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
Resolve Rubocop offenses #644
Resolve Rubocop offenses #644
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making this PR! I like the rule change to eliminate unnecessary escapes but it appears that some of these changes are unsafe and have changed the output of these bundled configurations.
Unless @jaredcwhite objects, I would disable this rule for the bridgetown-core/lib/bridgetown-core/configurations/**/*.rb
folder.
I also personally like to squash these but it can be squashed on merge so I'll leave that up to you.
@andrewmcodes @vvveebs I agree, I would like to avoid changing anything that ends up as output in user projects at the present moment. |
Thanks both. I remember having some fun with the config files and their output when I made this :) I believe there are a few little edge case bugs which I was attempting to fix here rather than add an overarching Rubocop ignore rule but I probably didn't do a great job of explaining where I was coming from. If I don't hear from folks in the coming days, I'll make a dedicated issue and add an ignore rule so we can move on :) Essentially I think we are ending up creating a couple of regexes which contain the "any character" character class ( It's best to give an example in JS. Taking the example of the post CSS filter regex:
A similar pattern seems to be in the stimulus config which modifies controller filenames. I doubt anyone has been stung by these edge cases but I figured best to try to fix them (with an additional escape |
Daaaang… @vvveebs you're right! After trying this out manually, turns out in a heredoc we have some odd escaping gotchas just like in regular strings. So in that JS heredoc, |
@vvveebs well TIL 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these are correct as @jaredcwhite mentioned than this is good to go from my perspective! Thanks @vvveebs!
62ac38c
to
502c5b1
Compare
- Resolve empty hash layout cop - Remove redundant string escape sequences - Disable class length cop for Collection class
Previously these parts of the resulting regex would match any single character. Since we're constructing a regex from a string, escaping of the forward slash is needed.
4fe25f1
to
8cb43b1
Compare
Seems that we need to add a #setup call in the more recent version of zeitwerk. https://github.com/fxn/zeitwerk/blob/4d88e4ffeef65bdedc5077deae59e729b25a6c34/CHANGELOG.md#265-6-november-2022
Now that 'main' is our fallback, we need a test for the repo default in Utils.default_github_branch_name - done here using a stubbed response.
Need to find the locale by string instead of symbol in this case as the relevant part of the .yml is an item in a list.
9d57e61
to
6fdada7
Compare
Thanks folks. I realised that there were some more steps to get the build reinstated. Think they have been ticked off now hopefully - learnt some things along the way. Here's the latest on this PR:
|
Thanks for getting this over the edge @vvveebs. 🙏🏻 There might be a couple more things to massage here or there but probably makes sense to do that as new PRs off of main. Merging! |
Reviewers - let me know if you want these squashed down to a single commit.