Skip to content

Commit

Permalink
flow ls --strip-root --json --explain was broken
Browse files Browse the repository at this point in the history
Summary:
The `--explain` flag was returning the wrong results when
`--strip-root` and `--json` were passed through.

Reviewed By: samwgoldman

Differential Revision: D5881809

fbshipit-source-id: 3d215b14377454901c547d414868501620b186a2
  • Loading branch information
gabelevi authored and facebook-github-bot committed Sep 22, 2017
1 parent 2b3ae53 commit 8708e4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions newtests/ls_command/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,22 +155,22 @@ export default suite(({addFile, flowCmd, removeFile}) => [
`
{
"../other/explicitly_included.js": {
"explanation": "ImplicitlyIgnored"
"explanation": "ExplicitlyIncluded"
},
"../other/implicitly_ignored.js": {
"explanation": "ImplicitlyIgnored"
},
"explicit_lib.js": {
"explanation": "ImplicitlyIgnored"
"explanation": "ExplicitLib"
},
"explicitly_ignored.js": {
"explanation": "ImplicitlyIgnored"
"explanation": "ExplicitlyIgnored"
},
"flow-typed/implicit_lib.js": {
"explanation": "ImplicitlyIgnored"
"explanation": "ImplicitLib"
},
"implicitly_included.js": {
"explanation": "ImplicitlyIgnored"
"explanation": "ImplicitlyIncluded"
}
}
`,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/lsCommand.ml
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ let main
if reason
then
files
|> List.map normalize_filename
|> List.map (is_included ~root ~options ~libs)
|> List.map (fun (f, r) -> normalize_filename f, r)
|> json_of_files_with_explanations
else JSON_Array (
List.map (fun f -> JSON_String (normalize_filename f)) files
Expand Down

0 comments on commit 8708e4c

Please sign in to comment.