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

Auditing: Add rails_best_practices checks to Travis build, do cleanup #2703

Merged
merged 6 commits into from
Nov 6, 2019

Conversation

kevinrobinson
Copy link
Contributor

@kevinrobinson kevinrobinson commented Nov 6, 2019

This adds a subset of https://github.com/flyerhzm/rails_best_practices, does cleanup on the items it found, and adds the check to the Travis build.

These include:

  • removing unused methods
  • calling ActiveRecord operations and ignoring the return value (change to bang methods)
  • removed some old rake tasks related to schools (synced differently now)

Some other config was just noise, so those are disabled here in rails_best_practices.yml.

EDIT: I also looked at UseBeforeFilterCheck which seems potential useful but is too noisy.

This also updates administrate to be more explicit, and limit open routes as helpfully pointed out by RestrictAutoGeneratedRoutesCheck.

# removed
admin/educators#create
admin/educators#new
admin/educators#destroy

# kept, explicitly now
admin/educators#index
admin/educators#show
admin/educators#edit
admin/educators#update

@kevinrobinson
Copy link
Contributor Author

example of how failures look in the build:
Screen Shot 2019-11-06 at 3 15 33 PM

@kevinrobinson
Copy link
Contributor Author

selfie

@kevinrobinson kevinrobinson merged commit 8fd95a3 into master Nov 6, 2019
@kevinrobinson kevinrobinson deleted the feature/rails-best-practices-tooling branch November 6, 2019 20:42
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.

1 participant