Commit Graph

24 Commits

Author SHA1 Message Date
Cody Cutrer 103dce1f4a add frozen_string_literal comment to binaries
Change-Id: I4d0b95c1f22891772cfdc8a20adf0ff1e1bc8a8b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261819
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2021-03-30 18:14:03 +00:00
Aaron Ogata 4cd931dd92 add skip-eslint flag
refs DE-565

Change-Id: Idbcc8ac2b4d780c6cf5cf26a4fcdcec85bc86eb3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260812
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
2021-03-16 18:02:37 +00:00
Rex Fleischer 9454b7cd97 remove skipping linters if whitelisted engineer
fixes: CCI-362
flag = none

Test-Plan:
build passes

Change-Id: Ied7b5c1923bb1c5e0314b13b7cab8d9e9a93028a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236433
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Product-Review: Gentry Beckmann <gbeckmann@instructure.com>
QA-Review: Rex Fleischer <rfleischer@instructure.com>
2020-05-08 15:17:49 +00:00
Benjamin Christian Nelson 9a20868030 remove unused selinimum gem
Change-Id: I0adc219a6cab442226619d5bdd0814d7f09d0d52
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/230713
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
QA-Review: Jacob Powell <spowell@instructure.com>
Product-Review: Jacob Powell <spowell@instructure.com>
2020-04-23 17:25:57 +00:00
Rex Fleischer 15a0e84100 move linters to main build to include rebased changes
fixes: CCI-280
flag = none

Test-Plan:
it doesnt sent the migration warning

Change-Id: I6669adfc2ff937a3596e22a5a9b267c5e9349721
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/229304
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Jacob Powell <spowell@instructure.com>
QA-Review: Rex Fleischer <rfleischer@instructure.com>
Product-Review: Rex Fleischer <rfleischer@instructure.com>
2020-03-13 18:50:43 +00:00
Rex Fleischer 20a0aedd0f add link in commit message linters for release flag format
fixes: CCI-159
flag = none

Test-Plan:
dont add a flag here and make sure it links in builds.

Change-Id: I7c424cc66c17de33982639650ed9167a1c762b7d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/220944
Tested-by: Jenkins
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: Rex Fleischer <rfleischer@instructure.com>
Product-Review: Rex Fleischer <rfleischer@instructure.com>
2019-12-20 17:17:21 +00:00
Steven Burnett 0dd1a45d95 add warning for migration review
fixes KNO-140
flag=none

Test Plan:
- commit or modify a migration file
- notice gergich -1 your commit and leaves a comment
- tests still pass
- celebrate

Change-Id: Ic5b353c1750f65c7de988fc6ce9ed68f16db352f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219997
Tested-by: Jenkins
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-12-10 00:10:25 +00:00
Rex Fleischer 7b55861c04 add linter for checking flag is set in a commit message
fixes: CCI-73

flag=none

Test-Plan:
push the commit without a flag, then do it with and
ensure the gergich messages are correct

Change-Id: I28b6691482e01547f7ffdc50c70123a329e195b5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219403
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Rex Fleischer <rfleischer@instructure.com>
Product-Review: Rex Fleischer <rfleischer@instructure.com>
2019-12-04 19:16:34 +00:00
Clay Diffrient 679f1cb699 Add length exemption for revert commit messages
This will make it so revert commits can make it through
without needing truncation done on the original commit message

Test Plan:
  - Amend this commit and make the commit message really long
  - Run script/lint_commit_message
  - It will output an error message about length
  - Amend the commit again and put "Revert" at the beginning
    of the subject line.
  - Run the linter again
  - It will not print out the error now

Change-Id: Id2b57e202a0bbd46dbc8de29d9bcc984c9c5fe99
Reviewed-on: https://gerrit.instructure.com/109316
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-21 04:03:36 +00:00
Jon Jensen dde8b3ca80 spec: stop linting for webpack topics
Change-Id: I8f3e0755de137a79fba477edeab23bd614e32c4d
Reviewed-on: https://gerrit.instructure.com/105458
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
2017-03-16 22:48:12 +00:00
Jon Jensen 3beaab5647 spec: bring test-queue rerun logic into canvas
Change-Id: I8b1cc0ed0c019eb67ee8d22df8e5f32b4b74cac2
Reviewed-on: https://gerrit.instructure.com/100475
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-01-25 22:29:41 +00:00
Landon Wilkins cf4a8f61f8 webpack commit msg linter, fixes SD-1860
test plan:
* should get a webpack comment on patchset 1

Change-Id: I3fcd5d22b2c9d1b1480958e0ea134e4fefaee714
Reviewed-on: https://gerrit.instructure.com/99354
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-01-13 02:26:07 +00:00
Landon Wilkins 16733a68a1 lint: whitelist UTF-8 for commit msg linter
Change-Id: If2a230b33ded44de52bc55cb5dd17622a53960fe
Reviewed-on: https://gerrit.instructure.com/97601
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2016-12-14 19:11:57 +00:00
Landon Wilkins 903c9a0a66 stylelint, refs SD-1603
test plan:
* add an invalid hex code to a scss file
  e.g. _variables.scss:
  color: #YARRRRRRRR
* run stylelint with: `script/stylelint`
* verify the colored output only returns your introduced error

Change-Id: Ia4f2adef3635f34154d50d61249b952a380208bf
Reviewed-on: https://gerrit.instructure.com/92229
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
2016-10-25 00:21:16 +00:00
Jon Jensen ef8d56076a avoid duplicate chdir, fixes SD-1442
test plan:
1. lint_commit_message should run and pass on this commit
2. it should lint a plugin commit if you set GERGICH_GIT_PATH and
   GERRIT_REFSPEC and not blow up on linting failures

Change-Id: I7349eb0885038ac11660b95a7e528735048be2bc
Reviewed-on: https://gerrit.instructure.com/88104
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2016-08-18 15:58:27 +00:00
Cody Cutrer 21561f5180 don't whine about no ticket when it's a github issue
Change-Id: I2b73964c64ece3b98a1809771402c53ea21e7621
Reviewed-on: https://gerrit.instructure.com/75653
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-03-29 20:43:26 +00:00
Jon Jensen b3e0fc8309 tighten up commit message linting
in spite of the only_report_errors list, this should be something everyone
can agree on

test plan:
* spec-only commits and commit messages should be linted whether or not the
  commiter is in the only_report_errors list

Change-Id: I077173db60f9f537d14f66b7acd396823e10a395
Reviewed-on: https://gerrit.instructure.com/65830
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2016-03-29 19:29:11 +00:00
Jon Jensen 556a0d13d9 fix commit message linting for plugins
test plan:
1. set GERGICH_GIT_PATH to a valid plugin gem path
2. script/lint_commit_message should lint according to the plugin's HEAD,
   not canvas-lms'

Change-Id: I0976c39ca8278d8241c37ed464b24fcdf7cd9e58
Reviewed-on: https://gerrit.instructure.com/71928
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2016-02-10 19:31:55 +00:00
Jon Jensen ee57027349 looser test plan check
test-plan:
* put an unnecessary hyphen there ^
* gergich should not complain

Change-Id: Id092e5e9430bd6d7cb95b3f583f3bd1a5b1e82b3
Reviewed-on: https://gerrit.instructure.com/65749
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
2015-10-26 20:42:44 +00:00
James Williams 9fab373292 extend gergich opt-out to lint_commit_message
sorry, not sorry; it's better than cloak'n'daggering

Change-Id: I641167cb402a616601e9c95499bec474947f4c66
Reviewed-on: https://gerrit.instructure.com/65719
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-10-23 15:29:19 +00:00
Jon Jensen 5d5af5827d allow # prefix for tickets
the # is not necessary, but now you won't get misleading linter messages
if you do one, e.g. refs #PROJ-123

test plan:
1. the linter should not complain about this commit message

Change-Id: I3eb9e5de093a5b8948c2892bd3ecdec8c3ea4add
Reviewed-on: https://gerrit.instructure.com/65225
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2015-10-15 17:10:24 +00:00
Jon Jensen b57ee36b1f make linter match jira_ref_parser behavior
now you can have a colon between refs and the ticket, e.g.
refs: FAKE-123

test plan:
1. this commit message should pass the linter (even though that's not a
   real ticket)

Change-Id: I32776d59c3ee2d7935c20caba759e0bd0b2596e9
Reviewed-on: https://gerrit.instructure.com/65208
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2015-10-15 14:53:55 +00:00
Jon Jensen 3c022771b0 selinimum: the saga continues
Now with full js/jsx/coffee/hbs/scss goodness \o/

If your commit ONLY touches js/jsx/coffee/hbs/scss/views/controllers or
specific whitelisted things, and doesn't touch global-y bundles or
layouts, then your commit may** be selinimized. That means it will only
run the selenium specs that care about those files.

If you touch lib, or gems, or models, or any global-y stuff, all the specs
will still run.

Also add the ability to override what we selinimize against when testing
changes to selinimum.

**Note that actual selinimization depends on a post-merge build having
succeeded for the parent (or a near ancestor). If the post-merge build
failed, or your build starts before it finishes, or there are
unselinimizable changes between your commit and the nearest ancestor with
selinimum stats, then your commit will not be selinimized :'(

See 4a83f6b6 for the full story.

Test Plan:
* Specs should pass on this commit
* It should not be selinimized because we touch package.json
* See dependent test commits where selinimization happens

Change-Id: I62c78c316876aaff07514a0f460ff4d608dac494
Reviewed-on: https://gerrit.instructure.com/65082
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2015-10-14 18:58:49 +00:00
Jon Jensen 6a3c12b883 add a commit message linter
ruby port of the useful pieces of bridge's bash linter

test plan:
1. run it on this commit
2. it should complain that there is no ticket :P
3. feed it a commit message via stdin, e.g.
   `echo -e "yay\n\na commit"|script/lint_commit_message --stdin`
4. confirm it behaves sensibly

Change-Id: I6bdd6db53e178c4d5d7372aafba47b60c4b9f076
Reviewed-on: https://gerrit.instructure.com/65124
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2015-10-14 18:58:19 +00:00