2019-03-17 14:40:57 +02:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
< html >
< head >
2020-04-14 19:56:54 +03:00
< title > Using Inpolicy< / title >
2020-05-03 03:20:55 +03:00
< link href = "../docs-assets/Breadcrumbs.css" rel = "stylesheet" rev = "stylesheet" type = "text/css" >
2020-03-19 02:11:25 +02:00
< meta name = "viewport" content = "width=device-width initial-scale=1" >
2019-03-17 14:40:57 +02:00
< meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" >
< meta http-equiv = "Content-Language" content = "en-gb" >
2020-05-03 03:01:21 +03:00
2020-05-03 03:20:55 +03:00
< link href = "../docs-assets/Contents.css" rel = "stylesheet" rev = "stylesheet" type = "text/css" >
< link href = "../docs-assets/Progress.css" rel = "stylesheet" rev = "stylesheet" type = "text/css" >
< link href = "../docs-assets/Navigation.css" rel = "stylesheet" rev = "stylesheet" type = "text/css" >
< link href = "../docs-assets/Fonts.css" rel = "stylesheet" rev = "stylesheet" type = "text/css" >
< link href = "../docs-assets/Base.css" rel = "stylesheet" rev = "stylesheet" type = "text/css" >
< link href = "../docs-assets/Colours.css" rel = "stylesheet" rev = "stylesheet" type = "text/css" >
< link href = "../docs-assets/ConsoleText-Colours.css" rel = "stylesheet" rev = "stylesheet" type = "text/css" >
2020-04-14 19:56:54 +03:00
2019-03-17 14:40:57 +02:00
< / head >
2020-05-03 03:01:21 +03:00
< body class = "commentary-font" >
2020-03-19 02:11:25 +02:00
< nav role = "navigation" >
2020-04-14 19:56:54 +03:00
< h1 > < a href = "../index.html" >
2020-05-03 18:34:53 +03:00
< img src = "../docs-assets/Inform.png" height = 72" >
2020-04-14 19:56:54 +03:00
< / a > < / h1 >
2022-04-04 20:31:44 +03:00
< ul > < li > < a href = "../index.html" > home< / a > < / li >
< / ul > < h2 > Compiler< / h2 > < ul >
< li > < a href = "../structure.html" > structure< / a > < / li >
< li > < a href = "../inbuildn.html" > inbuild< / a > < / li >
< li > < a href = "../inform7n.html" > inform7< / a > < / li >
< li > < a href = "../intern.html" > inter< / a > < / li >
< li > < a href = "../services.html" > services< / a > < / li >
2020-04-14 19:56:54 +03:00
< / ul > < h2 > Other Tools< / h2 > < ul >
2022-04-04 20:31:44 +03:00
< li > < a href = "../inblorbn.html" > inblorb< / a > < / li >
< li > < a href = "../indocn.html" > indoc< / a > < / li >
< li > < a href = "../inform6.html" > inform6< / a > < / li >
< li > < a href = "../inpolicyn.html" > inpolicy< / a > < / li >
< li > < a href = "../inrtpsn.html" > inrtps< / a > < / li >
2022-04-15 02:19:18 +03:00
< / ul > < h2 > Resources< / h2 > < ul >
< li > < a href = "../extensions.html" > extensions< / a > < / li >
< li > < a href = "../kits.html" > kits< / a > < / li >
2022-04-04 20:31:44 +03:00
< / ul > < h2 > Repository< / h2 > < ul >
< li > < a href = "https://github.com/ganelson/inform" > < img src = "../docs-assets/github.png" height = 18 > github< / a > < / li >
< / ul > < h2 > Related Projects< / h2 > < ul >
< li > < a href = "../../../inweb/docs/index.html" > inweb< / a > < / li >
< li > < a href = "../../../intest/docs/index.html" > intest< / a > < / li >
2020-03-19 02:11:25 +02:00
2020-04-14 19:56:54 +03:00
< / ul >
2020-03-19 02:11:25 +02:00
< / nav >
< main role = "main" >
2020-05-03 03:01:21 +03:00
<!-- Weave of 'Using Inpolicy' generated by Inweb -->
< div class = "breadcrumbs" >
2022-04-04 20:31:44 +03:00
< ul class = "crumbs" > < li > < a href = "../index.html" > Home< / a > < / li > < li > < a href = "index.html" > inpolicy< / a > < / li > < li > < a href = "index.html#M" > Manual< / a > < / li > < li > < b > Using Inpolicy< / b > < / li > < / ul > < / div >
2020-05-03 03:01:21 +03:00
< p class = "purpose" > A very short guide to a very small program.< / p >
2019-03-17 14:40:57 +02:00
2020-04-16 01:49:59 +03:00
< ul class = "toc" > < li > < a href = "M-ui.html#SP1" > § 1. What Inpolicy is< / a > < / li > < li > < a href = "M-ui.html#SP3" > § 3. Policies< / a > < / li > < / ul > < hr class = "tocbar" >
2019-03-17 14:40:57 +02:00
2020-08-27 17:50:24 +03:00
< p class = "commentary firstcommentary" > < a id = "SP1" class = "paragraph-anchor" > < / a > < b > § 1. What Inpolicy is. < / b > Inpolicy is a command-line tool whose sole purpose is to help keep the
2019-03-17 14:40:57 +02:00
Inform 7 source code tidy. Unlike Inweb, Intest and Indoc, this tool
can't sensibly be used for any project other than Inform.
< / p >
2020-05-03 03:01:21 +03:00
< p class = "commentary" > If you have compiled the standard distribution of the command-line tools
for Inform then the Inpolicy executable will be at < span class = "extract" > < span class = "extract-syntax" > inpolicy/Tangled/inpolicy< / span > < / span > .
2019-03-17 14:40:57 +02:00
Usage is very simple:
< / p >
2020-05-03 03:01:21 +03:00
< pre class = "ConsoleText-displayed-code all-displayed-code code-font" >
< span class = "ConsoleText-plain-syntax" > < / span > < span class = "ConsoleText-element-syntax" > $< / span > < span class = "ConsoleText-plain-syntax" > < / span > < span class = "ConsoleText-function-syntax" > inpolicy/Tangled/inpolicy< / span > < span class = "ConsoleText-plain-syntax" > POLICY< / span >
2019-03-17 14:40:57 +02:00
< / pre >
2020-05-03 03:01:21 +03:00
< p class = "commentary" > where < span class = "extract" > < span class = "ConsoleText-extract-syntax" > POLICY< / span > < / span > is whatever we want to check. There are very few at present;
2019-03-17 14:40:57 +02:00
in some ways this program is a placeholder for future tightening-up of the
style rules.
< / p >
2020-08-27 17:50:24 +03:00
< p class = "commentary firstcommentary" > < a id = "SP2" class = "paragraph-anchor" > < / a > < b > § 2. < / b > When it runs, Inpolicy needs to know where it is installed in the file
2019-03-17 14:40:57 +02:00
system. There is no completely foolproof, cross-platform way to know this
(on some Unixes, a program cannot determine its own location), so Inpolicy
decides by the following set of rules:
< / p >
2020-05-03 03:01:21 +03:00
< ul class = "items" > < li > (a) If the user, at the command line, specified < span class = "extract" > < span class = "ConsoleText-extract-syntax" > -at P< / span > < / span > , for some path
< span class = "extract" > < span class = "ConsoleText-extract-syntax" > P< / span > < / span > , then we use that.
2019-03-17 14:40:57 +02:00
< / li > < li > (b) Otherwise, if the host operating system can indeed tell us where the
executable is, we use that. This is currently implemented only on MacOS,
Windows and Linux.
2020-05-03 03:01:21 +03:00
< / li > < li > (c) Otherwise, if the environment variable < span class = "extract" > < span class = "ConsoleText-extract-syntax" > $INPOLICY_PATH< / span > < / span > exists and is
2019-03-17 14:40:57 +02:00
non-empty, we use that.
2020-05-03 03:01:21 +03:00
< / li > < li > (d) And if all else fails, we assume that the location is < span class = "extract" > < span class = "ConsoleText-extract-syntax" > inpolicy< / span > < / span > , with
2019-03-17 14:40:57 +02:00
respect to the current working directory.
< / li > < / ul >
2020-05-03 03:01:21 +03:00
< p class = "commentary" > If you're not sure what Inpolicy has decided and suspect it may be wrong,
running Inpolicy with the < span class = "extract" > < span class = "ConsoleText-extract-syntax" > -verbose< / span > < / span > switch will cause it to print its belief
2019-03-17 14:40:57 +02:00
about its location as it starts up.
< / p >
2020-08-27 17:50:24 +03:00
< p class = "commentary firstcommentary" > < a id = "SP3" class = "paragraph-anchor" > < / a > < b > § 3. Policies. < / b > < span class = "extract" > < span class = "ConsoleText-extract-syntax" > -check-problems< / span > < / span > makes a survey of (a) all of the Problem messages issued
2019-03-17 14:40:57 +02:00
within the Inform 7 compiler, (b) all of the Problem test cases, and (c) all
of the advisory references to Problems in the Inform documentation, and
attempts to match these up. It prints out a report, and concludes with either
"All is well" or a recommendation for changes. For example:
< / p >
2020-05-03 03:01:21 +03:00
< pre class = "ConsoleText-displayed-code all-displayed-code code-font" >
< span class = "ConsoleText-plain-syntax" > 1009 problem name(s) have been observed:< / span >
< span class = "ConsoleText-plain-syntax" > Problems actually existing (the source code refers to them):< / span >
< span class = "ConsoleText-plain-syntax" > 906 problem(s) are named and in principle testable< / span >
< span class = "ConsoleText-plain-syntax" > 81 problem(s) are 'BelievedImpossible', that is, no known source text causes them< / span >
< span class = "ConsoleText-plain-syntax" > 14 problem(s) are 'Untestable', that is, not mechanically testable< / span >
< span class = "ConsoleText-plain-syntax" > 8 problem(s) are '...', that is, they need to be give a name and a test case< / span >
< span class = "ConsoleText-plain-syntax" > Problems which should have test cases:< / span >
< span class = "ConsoleText-plain-syntax" > 904 problem(s) have test cases< / span >
< span class = "ConsoleText-plain-syntax" > 2 problem(s) have no test case yet:< / span >
< span class = "ConsoleText-plain-syntax" > PM_SuperfluousOf< / span >
< span class = "ConsoleText-plain-syntax" > PM_MisplacedFrom< / span >
< span class = "ConsoleText-plain-syntax" > Problems which are cross-referenced in 'Writing with Inform':< / span >
< span class = "ConsoleText-plain-syntax" > 483 problem(s) are cross-referenced< / span >
< span class = "ConsoleText-plain-syntax" > All is well.< / span >
2019-03-17 14:40:57 +02:00
< / pre >
2020-05-03 03:01:21 +03:00
< p class = "commentary" > As this example report shows, small sins are forgiven.
2019-03-17 14:40:57 +02:00
< / p >
2020-05-03 03:01:21 +03:00
< nav role = "progress" > < div class = "progresscontainer" >
< ul class = "progressbar" > < li class = "progressprevoff" > ❮ < / li > < li class = "progresscurrentchapter" > M< / li > < li class = "progresscurrent" > ui< / li > < li class = "progresssection" > < a href = "M-rc.html" > rc< / a > < / li > < li class = "progresschapter" > < a href = "1-bsc.html" > 1< / a > < / li > < li class = "progresschapter" > < a href = "2-pc.html" > 2< / a > < / li > < li class = "progressnext" > < a href = "M-rc.html" > ❯ < / a > < / li > < / ul > < / div >
< / nav > <!-- End of weave -->
2020-03-19 02:11:25 +02:00
< / main >
2019-03-17 14:40:57 +02:00
< / body >
< / html >