Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trim --fscoptions. #759

Merged
merged 1 commit into from
Aug 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 15.0.2
* Trim the `--fscoptions` before passing them as `otherflags`. ([comment #616](https://github.com/fsprojects/FSharp.Formatting/issues/616#issuecomment-1200877765))

## 15.0.1
* fix https://github.com/fsprojects/FSharp.Formatting/issues/749

Expand Down
4 changes: 2 additions & 2 deletions docs/apidocs.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,14 @@ Example as last line:
/// [omit]
module Bar =
let a = 42

(**
Example as first line:
*)

/// [omit]
/// Some actual comment
module Bar` =
module Bar2 =
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the build is failing because of this tick.

let a = 42

(**
Expand Down
35 changes: 18 additions & 17 deletions docs/commandline.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,24 @@ rules of [API doc generation](apidocs.html). The input accepted is described in

The command line options accepted are:

| Command Line Option | Description |
|:-----------------------|:-----------------------------------------|
| `--input` | Input directory of content (default: `docs`) |
| `--projects` | Project files to build API docs for outputs, defaults to all packable projects |
| `--output` | Output Directory (default 'output' for 'build' and 'tmp/watch' for 'watch') |
| `--noapidocs` | Disable generation of API docs |
| `--eval` | Evaluate F# fragments in scripts |
| `--saveimages` | Save images referenced in docs |
| `--nolinenumbers` | Don't add line numbers, default is to add line number. |
| `--parameters` | Additional substitution parameters for templates |
| `--nonpublic` | The tool will also generate documentation for non-public members |
| `--nodefaultcontent` | Do not copy default content styles, javascript or use default templates |
| `--clean` | Clean the output directory |
| `--help` | Display this help screen |
| `--version` | Display version information |
| `--properties` | Provide properties to dotnet msbuild, e.g. --properties Configuration=Release Version=3.4 |
| `--strict` | Fail if docs are missing or can't be generated |
| Command Line Option | Description |
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for updating the entire table, the IDE aligned everything automatically 😅.

|:---------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `--input` | Input directory of content (default: `docs`) |
| `--projects` | Project files to build API docs for outputs, defaults to all packable projects |
| `--output` | Output Directory (default 'output' for 'build' and 'tmp/watch' for 'watch') |
| `--noapidocs` | Disable generation of API docs |
| `--eval` | Evaluate F# fragments in scripts |
| `--saveimages` | Save images referenced in docs |
| `--nolinenumbers` | Don't add line numbers, default is to add line number. |
| `--parameters` | Additional substitution parameters for templates |
| `--nonpublic` | The tool will also generate documentation for non-public members |
| `--nodefaultcontent` | Do not copy default content styles, javascript or use default templates |
| `--clean` | Clean the output directory |
| `--help` | Display this help screen |
| `--version` | Display version information |
| `--properties` | Provide properties to dotnet msbuild, e.g. --properties Configuration=Release Version=3.4 |
| `--fscoptions` | Additional arguments passed down as `otherflags` to the F# compiler when the API is being generated.<br/>Note that these arguments are trimmed, this is to overcome [a limitation in the command line argument processing](https://github.com/commandlineparser/commandline/issues/58).<br/>A typical use-case would be to pass an addition assembly reference.<br/>Example `--fscoptions " -r:MyAssembly.dll"` |
| `--strict` | Fail if docs are missing or can't be generated |

The following command line options are also accepted but it is instead recommended you use
settings in your .fsproj project files:
Expand Down
2 changes: 1 addition & 1 deletion src/FSharp.Formatting.ApiDocs/GenerateModel.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2985,7 +2985,7 @@ type ApiDocModel internal (substitutions, collection, entityInfos, root, qualify

// Default template file names

let otherFlags = defaultArg otherFlags []
let otherFlags = defaultArg otherFlags [] |> List.map (fun (o: string) -> o.Trim())

let libDirs = defaultArg libDirs [] |> List.map Path.GetFullPath

Expand Down