diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2021-01-29 20:05:14 +0100 |
---|---|---|
committer | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2021-01-30 21:11:21 +0100 |
commit | 14c4f7014d1bbdf51a79745821fcfc39e7db0ec9 (patch) | |
tree | 45443e15d5e1e862ae5c9838dfc0b0c51fa2318e /docs/users_guide/compare-flags.py | |
parent | eb90d23911ee10868dc2c7cc27a8397f0ae9b41d (diff) | |
download | haskell-14c4f7014d1bbdf51a79745821fcfc39e7db0ec9.tar.gz |
Documentation fixes
- Add missing :since: for NondecreasingIndentation and OverlappingInstances
- Remove duplicated descriptions for Safe Haskell flags and
UndecidableInstances. Instead, the sections contain a link.
- compare-flags: Also check for options supported by ghci.
This uncovered two more that are not documented.
The flag -smp was removed.
- Formatting fixes
- Remove the warning about -XNoImplicitPrelude - it was written in 1996,
the extension is no longer dangerous.
- Fix misspelled :reverse: flags
Fixes #18958.
Diffstat (limited to 'docs/users_guide/compare-flags.py')
-rwxr-xr-x | docs/users_guide/compare-flags.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/docs/users_guide/compare-flags.py b/docs/users_guide/compare-flags.py index 81a11b90e5..e858e3011b 100755 --- a/docs/users_guide/compare-flags.py +++ b/docs/users_guide/compare-flags.py @@ -49,8 +49,11 @@ def read_documented_flags(doc_flags) -> Set[str]: def read_ghc_flags(ghc_path: str) -> Set[str]: ghc_output = subprocess.check_output([ghc_path, '--show-options']) - flags = {flag.strip() for flag in ghc_output.decode('UTF-8').split('\n')} - return {flag for flag in flags + ghci_output = subprocess.check_output([ghc_path, '--interactive', '--show-options']) + + return {flag + for flag in ghc_output.decode('UTF-8').splitlines() + + ghci_output.decode('UTF-8').splitlines() if not expected_undocumented(flag) if flag != ''} @@ -61,9 +64,11 @@ def main() -> None: import argparse parser = argparse.ArgumentParser() parser.add_argument('--ghc', type=argparse.FileType('r'), - help='path of GHC executable') + help='path of GHC executable', + required=True) parser.add_argument('--doc-flags', type=argparse.FileType(mode='r', encoding='UTF-8'), - help='path of ghc-flags.txt output from Sphinx') + help='path of ghc-flags.txt output from Sphinx', + required=True) args = parser.parse_args() doc_flags = read_documented_flags(args.doc_flags) |