Pull latest / greatest from stringer#1
Merged
Conversation
Mostly by prefixing the unused arguments with `_` to indicate they're unused. This is because the unused arguments are often parts of protocols/interfaces. Does remove the unused `parser` parameter from `get_feed_for_url`, though.
This is done by rescuing `StandardError` instead of `Exception`, which should still cover most if not all errors raised by the Curb and Feedjira libraries. We no longer try to rescue fatal errors, like `NoMemoryError`, which is what RuboCop was complaining about. An even better fix for this could be to rescue an even narrower set of errors, but I'll leave that until the next time.
Fix RuboCop lint offences
Only one autofocus element per page is allowed.
> ### delete([other_str]+) -> new_str > > Returns a copy of *str* with all characters in the intersection of its > arguments deleted. Uses the same rules for building the set of characters as > `String#count`. See <http://ruby-doc.org/core-2.0.0/String.html#method-i-delete>.
Fix RuboCop performance offences
Autofocus
...through some light refactorings.
...through a small refactoring of `Sinatra::AuthenticationHelpers#needs_authentication?`.
Matt and I agreed that 120 characters is a sensible maximum line length for modern editors, see <#395 (comment)>. Also set the `MaxLineLength` option for two other cops, since they're related. Joins lines in the Fever API files to fix warnings from `Style/IfUnlessModifier`.
Despite my best efforts, I find it hard to keep all methods below or at the default maximum length of 10 lines. 15 lines is a somewhat arbitrary compromise that's subject to future tweaking. See also: <https://robots.thoughtbot.com/sandi-metz-rules-for-developers>
Fixes Metrics/ClassLength by extracting `StoryRepository#expand_absolute_urls` and `StoryRepository#normalize_url` to a separate helper module.
Fix RuboCop metrics offences
Adds group_id to Feeds#edit
Also adjust the way that factories are required and introduce a `next_id` helper. There are still some untested methods in StoryRepository which I will continue to work on in followups.
… new rubocop warnings (#541)
These gems aren't dependencies anywhere. Not sure why they are still lurking in our Gemfile.lock, but every time I run bundle it removes them, so might as well commit that.
This makes it so that we can pass input and output to ChangePassword in order to test against them, and prevent them from outputting in the tests.
ActiveRecord no longer wants us to pass SQL fragments to `order`. This instead makes use of the underlying framework Arel to generate the query.
I'm a little surprised this was possible, but #533 introduced a version of ActiveRecord that did not match the constraints of `delayed_job_active_record`. I thought bundler was more strict, but it somehow allowed this one to slip through. This fixes the issue.
fix a rubocop alert from the newer version faker work around a capybara change
And auto generate the configuration
This is super janky, grabbing the instance variable out of the instance, but there doesn't seem to be a great way to test for the underlying issue, which is that in some cases jobs don't work when passing the entire record. I thought also about inspecting the job more closely, but wasn't able to think of a great solution there, either. I'd like to refactor this class some down the road to not try to juggle both `@feeds_ids` and `@feeds` variables.
I enabled settings for test mode, which doesn't seem to noticeably impact performance, but gives us a little bit more test coverage.
* Add tests for `.fetch_by_ids`, `.delete`, `.list`, and `.in_group` * Rearrange test file to mirror ordering of class * Fix deprecation warning for `lower(name)` * Refactor `in_group` query to use AR syntax
This adds `rubocop-rails`, `rubocop-rake`, and `rubocop-rspec`. Even though this project doesn't use Rails, a lot of the same linters will apply. Also regenerates `.rubocop_todo.yml` based on the new rules.
The test wasn't actually executing the method under test, so it wasn't verifying anything.
Also made it so that auth check applies in test mode as well. Needed to make a couple of other changes to tests to get them working.
This brings test coverage up to 100%, so I'm also enabling the `minimum_coverage` threshold to make sure it stays there.
There doesn't appear to be anything in [the major release][release] that should impact us. [release]: https://github.com/defunkt/unicorn/releases/tag/v6.0.0
This blocks upgrading to ActiveRecord 6.x, as the query for `true`/`false` values is different for some reason depending on the database, and it fails tests with SQLite. The simplest solution in this case is probably to remove SQLite. The production setup uses Postgres, so better to have a consistent database setup, anyway. This also frees us up to take advantage of Postgres specific features.
I needed to update the format of the json being returned in the tests. I'm not sure if it actually ends up changing the result when the dates are converted to JSON strings, but it doesn't look like anything client or server relies particularly on the format, so we should be fine. Also updates the formatting in `schema.rb` by running `rake db:migrate`. All of the changes look to be cosmetic.
This updates minor versions of gems.
The [coveralls gem][gem] hasn't been updated in more than a year. The [reborn][reborn] is a more up to date version that doesn't lock us down on an older version of SimpleCov. We may want to consider removing Coveralls entirely and just using the CI coverage, perhaps also keeping the artifacts for easy reference. [gem]: https://github.com/lemurheavy/coveralls-ruby [reborn]: https://github.com/tagliala/coveralls-ruby-reborn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
YOLO