Page MenuHomePhabricator

Specify minimum versions for linters in lint unit tests
Needs RevisionPublic

Authored by epriestley on May 12 2014, 12:19 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 24, 9:49 PM
Unknown Object (File)
Sun, Apr 21, 3:50 PM
Unknown Object (File)
Wed, Apr 17, 2:49 PM
Unknown Object (File)
Thu, Apr 11, 7:20 AM
Unknown Object (File)
Mar 14 2024, 4:17 AM
Unknown Object (File)
Mar 10 2024, 8:21 PM
Unknown Object (File)
Feb 12 2024, 5:39 PM
Unknown Object (File)
Feb 9 2024, 1:51 PM
Subscribers

Details

Summary

Ref T2039. Some of the tests don't pass on older linters. Allow tests to specify a minimum external linter version.

Also fix two minor issues:

  • jshint emits version info on stderr, not stdout.
  • flake8 2.0 just had "2.0", not "2.0.0", as its version string.
Test Plan

Ran arc unit, got skips, updated, got passing tests. See tests on this diff.

Diff Detail

Repository
rARC Arcanist
Branch
uminversion
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 373
Build 373: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

epriestley retitled this revision from to Specify minimum versions for linters in lint unit tests.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added reviewers: joshuaspence, btrahan.
epriestley added a task: Restricted Maniphest Task.
joshuaspence edited edge metadata.

I think a bit more work is required here.

src/lint/linter/__tests__/ArcanistLinterTestCase.php
11

Originally, I thought that we may want to specify the minimum version on a per-test-case basis. If we just skip all of the tests based on the version number, then it's hard to tell what the minimum version (of the external linter) that we support is.

117

I think that the version_compare logic should exist in the ArcanistLinter class itself. By default we can use version_compare, however for some linters we may need to provide some custom/additional logic. Also, for some linters it doesn't even make sense to compare version numbers (because there are none).

This revision now requires changes to proceed.May 12 2014, 12:28 AM

Yeah, that seems reasonable. I probably won't get to this tonight, I think I need to fix how we detect/skip unavailable linters first.