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)
Tue, Dec 17, 7:45 AM
Unknown Object (File)
Tue, Dec 17, 6:18 AM
Unknown Object (File)
Thu, Dec 12, 12:10 PM
Unknown Object (File)
Tue, Nov 26, 6:42 PM
Unknown Object (File)
Tue, Nov 26, 6:07 PM
Unknown Object (File)
Nov 17 2024, 12:18 AM
Unknown Object (File)
Oct 21 2024, 6:53 AM
Unknown Object (File)
Oct 20 2024, 6:05 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.