Skip to content

Commit b722d2f

Browse files
committed
Further clarify configuration file documentation
1 parent 6d6394e commit b722d2f

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

doc/script_command.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ The `stack script` command either runs a specified Haskell source file (using
1313
GHC's `runghc`) or, optionally, compiles such a file (using GHC) and, by
1414
default, runs it.
1515

16-
Unlike [`stack ghc`](ghc_command.md) and [`stack runghc`](runghc_command.md),
17-
the command ignores any project-level configuration file (`stack.yaml`, by
18-
default) (including in the `global-project` directory in the Stack root). A
19-
snapshot must be specified on the command line (with the `--snapshot` option).
20-
For example:
16+
Unlike the [`stack ghc`](ghc_command.md) and [`stack runghc`](runghc_command.md)
17+
commands, the command ignores any project-level configuration file
18+
(`stack.yaml`, by default) (including in the `global-project` directory in the
19+
Stack root). Consequently, a snapshot must be specified on the command line
20+
(with the `--snapshot` option). For example:
2121

2222
~~~text
2323
stack script --snapshot lts-22.21 MyScript.hs
@@ -26,8 +26,8 @@ stack script --snapshot lts-22.21 MyScript.hs
2626
!!! info
2727

2828
Non-project level configuration options in global configuration files
29-
(`config.yaml`), are not ignored. Such options may be useful if
30-
[`allow-newer`](yaml_configuration.md#allow-newer) and/or
29+
(`config.yaml`), are not ignored by the `stack script` command. Such options
30+
may be useful if [`allow-newer`](yaml_configuration.md#allow-newer) and/or
3131
[`allow-newer-deps`](yaml_configuration.md#allow-newer-deps) are required.
3232

3333
The `stack script` command behaves as if the `--install-ghc` flag had been

doc/scripts.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,20 +170,24 @@ providing a comma or space separated list. For example:
170170

171171
## Stack configuration for scripts
172172

173-
As with using [`stack script`](script_command.md) at the command line, any
174-
project-level configuration file (`stack.yaml`, by default) (including in the
175-
`global-project` directory in the Stack root) is ignored.
173+
As with using the [`stack script`](script_command.md) command at the command
174+
line, any project-level configuration file (`stack.yaml`, by default) (including
175+
in the `global-project` directory in the Stack root), including any specified by
176+
the `stack script` command itself, is ignored.
176177

177178
!!! info
178179

179180
Non-project level configuration options in global configuration files
180-
(`config.yaml`), are not ignored.
181-
182-
With the [`stack runghc`](runghc_command.md) command, if the current working
183-
directory is inside a project then that project's Stack project-level
184-
configuration file is effective when running the script. Otherwise the script
185-
uses the project-level configuration file in the `global-project` directory of
186-
the Stack root.
181+
(`config.yaml`), are not ignored by the [`stack script`](script_command.md)
182+
command. Such options may be useful if
183+
[`allow-newer`](yaml_configuration.md#allow-newer) and/or
184+
[`allow-newer-deps`](yaml_configuration.md#allow-newer-deps) are required.
185+
186+
As with using the [`stack runghc`](runghc_command.md) command at the command
187+
line, if the current working directory is inside a project, then that project's
188+
project-level configuration file is effective when running the script. Otherwise
189+
the script uses the project-level configuration file in the `global-project`
190+
directory in the Stack root.
187191

188192
## Testing scripts
189193

0 commit comments

Comments
 (0)