Skip to content

Instantly share code, notes, and snippets.

@ryangreenberg
Created August 9, 2019 17:01
Show Gist options
  • Save ryangreenberg/d96c0f2fccacf7a0f14fa1f49d290b53 to your computer and use it in GitHub Desktop.
Save ryangreenberg/d96c0f2fccacf7a0f14fa1f49d290b53 to your computer and use it in GitHub Desktop.
{
"roots": [
"vendor/"
],
"builtinLinters": "none",
"overrides": [
{
"patterns": [
"*"
],
"extraLinters": [
"Facebook\\HHAST\\UnusedVariableLinter"
]
}
]
}
{
"passed": false,
"errors": [
{
"path": ".../hhast/vendor/facebook/fbexpect/src/ExpectObj.hack",
"range": {
"start": {
"line": 589,
"character": 8
},
"end": {
"line": 589,
"character": 12
}
},
"message": "Variable is unused",
"linter": "UnusedVariable"
},
{
"path": ".../hhast/vendor/facebook/difflib/src/cluster.php",
"range": {
"start": {
"line": 24,
"character": 2
},
"end": {
"line": 24,
"character": 8
}
},
"message": "Variable is unused",
"linter": "UnusedVariable"
},
{
"path": ".../hhast/vendor/facebook/hack-codegen/src/PartiallyGeneratedCode.hack",
"range": {
"start": {
"line": 129,
"character": 56
},
"end": {
"line": 129,
"character": 64
}
},
"message": "Variable is unused",
"linter": "UnusedVariable"
},
{
"path": ".../hhast/vendor/facebook/hack-codegen/src/PartiallyGeneratedCode.hack",
"range": {
"start": {
"line": 144,
"character": 4
},
"end": {
"line": 144,
"character": 11
}
},
"message": "Variable is unused",
"linter": "UnusedVariable"
},
{
"path": ".../hhast/vendor/facebook/hack-codegen/src/PartiallyGeneratedCode.hack",
"range": {
"start": {
"line": 151,
"character": 4
},
"end": {
"line": 151,
"character": 11
}
},
"message": "Variable is unused",
"linter": "UnusedVariable"
},
{
"path": ".../hhast/vendor/facebook/hh-clilib/src/CLIBase.hack",
"range": {
"start": {
"line": 213,
"character": 4
},
"end": {
"line": 213,
"character": 16
}
},
"message": "Variable is unused",
"linter": "UnusedVariable"
}
]
}
hhast git:(unused_variables) ✗ bin/hhast-lint
Variable is unused
Linter: Facebook\HHAST\UnusedVariableLinter
Location: /Users/greenberg/code/hhast/vendor/facebook/fbexpect/src/ExpectObj.hack:589:8
@@ -586,7 +586,7 @@
$returned = \call_user_func_array($callable, $args);
if ($returned is Awaitable<_>) {
- $ret = \HH\Asio\join($returned);
+ $_ret = \HH\Asio\join($returned);
}
} catch (\Exception $e) {
$e = expect($e)->toBeInstanceOf(
Would you like to apply this fix?
[y]es/[n]o/yes to [a]ll/n[o] to all: o
Variable is unused
Linter: Facebook\HHAST\UnusedVariableLinter
Location: /Users/greenberg/code/hhast/vendor/facebook/difflib/src/cluster.php:24:2
@@ -21,7 +21,7 @@
vec<DiffOp<T>> $diff,
): vec<DiffOp<vec<T>>> {
$clusters = vec[];
- $limit = C\count($diff);
+ $_limit = C\count($diff);
while (!C\is_empty($diff)) {
$class = $diff[0]->getDiffOpClass();
Would you like to apply this fix?
<no to all>
Variable is unused
Linter: Facebook\HHAST\UnusedVariableLinter
Location: /Users/greenberg/code/hhast/vendor/facebook/hack-codegen/src/PartiallyGeneratedCode.hack:129:56
@@ -126,7 +126,7 @@
* manual sections, duplicated ids, etc)
*/
public function assertValidManualSections(): void {
- foreach ($this->iterateCodeSections($this->code) as $section) {
+ foreach ($this->iterateCodeSections($this->code) as $_section) {
}
}
Would you like to apply this fix?
<no to all>
Variable is unused
Linter: Facebook\HHAST\UnusedVariableLinter
Location: /Users/greenberg/code/hhast/vendor/facebook/hack-codegen/src/PartiallyGeneratedCode.hack:144:4
@@ -141,7 +141,7 @@
string $code,
): \Generator<int, (?string, string), void> {
// Regular expression to match the beginning of a manual section
- $quoted = \preg_quote(self::$manualBegin, '/');
+ $_quoted = \preg_quote(self::$manualBegin, '/');
$begin = self::getBeginManualSectionRegex('(.*)');
$valid_begin = self::getBeginManualSectionRegex('([A-Za-z0-9:_]+)');
Would you like to apply this fix?
<no to all>
Variable is unused
Linter: Facebook\HHAST\UnusedVariableLinter
Location: /Users/greenberg/code/hhast/vendor/facebook/hack-codegen/src/PartiallyGeneratedCode.hack:151:4
@@ -148,7 +148,7 @@
$seen_ids = keyset[];
$current_id = null;
$chunk = array();
- $manual = array();
+ $_manual = array();
$lines = \explode("\n", $code);
foreach ($lines as $line) {
if (\strpos($line, self::$manualEnd) !== false) {
Would you like to apply this fix?
<no to all>
Variable is unused
Linter: Facebook\HHAST\UnusedVariableLinter
Location: /Users/greenberg/code/hhast/vendor/facebook/hh-clilib/src/CLIBase.hack:213:4
@@ -210,7 +210,7 @@
// Ignore process name in $argv[0]
$argv = Vec\drop($argv, 1);
- $not_options = vec[];
+ $_not_options = vec[];
$options = $this->getSupportedOptions();
Would you like to apply this fix?
<no to all>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment