-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the latest language version if we can't find a package. (#1573)
Use the latest language version if we can't find a package. In the new tall-style behavior where we look for a surrounding package config to infer the language version of each file, we have to decide what to do when that look-up process fails (either because there is no package config, or it's malformed). Initially, I had it error out on that file. That's consistent with the library API where the formatter *requires* a language version before it will do anything. But it's not consistent with the language spec and our other tools. For them, if there is no valid surrounding package config, the file should be treated as the latest language version. This PR does that. It also fixes the catastrophic UX that the current code has which is that when a file can't have its language version inferred... it is silently skipped without telling the user anything. Oops. Now it just formats the file as expected.
- Loading branch information
1 parent
9c17d3b
commit 618883f
Showing
3 changed files
with
47 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters