since we're not enabling _any_ auto-correct if there are still existing
violations, it seems easier to enable unsafe autocorrects for new code,
when you're most likely to know how to fix it. instead of getting
frustrated and wondering why gergich is complaining about something that
should have been auto-corrected
Change-Id: Ic81316c790820e2d32a1b1826c79ccaa77d1d6ad
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278081
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
/bin/sh has apparently different syntax for [. I get this error (on
Linux).
hooks/pre-commit: 7: [: /home/evan/dev/canvas-lms: unexpected operator
Change-Id: I6f84881cab4ab3b2e1834457f5afa9954e9e203e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274839
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
but do run rlint (correctly) for plugins
Change-Id: I6728c3e5ce28196caa91ca6d3425097b88e067f6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274421
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
since auto-correct always does the entire file, don't make it possible
to correct something _and_ filter out that it was corrected just cause
the current patchset didn't touch it
Change-Id: I7b37bfa89f85b66520db922b7214462f7445eafe
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274314
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
* remove spurious .rubocop.yml override files
* split the configuration into an enforced and optional
* run both configurations in jenkins (may result in some duplicate
comments at different levels)
* auto-correct the enforced configuration in the pre-commit hook
* fix comments for Gemfile.d and the root dir; enforced configuration
is only applied to that directory for now
Change-Id: I8da21073d74e19138b1b580d66c7aae6465348d4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273898
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
test plan:
- have a local yarn install
- add an unfixable lint error (unused var) to a file in the prettier
whitelist
- try to commit the file
- it should not try to run in docker after the lint error
Change-Id: If1fcfc6693be26c6f6fdddb8cfa4c54a73512ebe
Reviewed-on: https://gerrit.instructure.com/173469
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
This only affects javascript files and only affects things
from the prettier whitelist
This will run slowly if you don't have node_modules installed
locally (e.g., in Docker), but it will gladly attempt to
run things in Docker for you.
This adds a new githook_installer image that will install
the githook whenever a docker-compose up happens in the
repo. It will also install the hook whenever a `yarn`
occurs locally (as a postinstall hook).
This commit should also not fail things. For example
having unused variables is an ESLint error, but it isn't
autofixable. It will log the error, but will otherwise
continue. However, it will make this pretty with prettier
as well as fix any other autofixable ESLint errors.
closes CORE-2118
Test Plan:
- Run `yarn`
- Add some semicolons to something from the whitelist
- git add that file
- git commit and it will strip semicolons
- In a dockerized Canvas:
- docker-compose up
- Add semicolons to a file
- git add that file
- git commit, it will take forever (~60s)
- It should have stripped out semicolons
Change-Id: Id9198aa008808e898f29acb9ed64dd14ff843222
Reviewed-on: https://gerrit.instructure.com/171510
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>