1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-03 07:24:58 +03:00
inform7/docs/inpolicy/M-ui.html
2020-04-07 23:02:44 +01:00

116 lines
5.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Booklet Title</title>
<meta name="viewport" content="width=device-width initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-gb">
<link href="../inweb.css" rel="stylesheet" rev="stylesheet" type="text/css">
</head>
<body>
<nav role="navigation">
<h1><a href="../webs.html">Sources</a></h1>
<ul>
<li><a href="../compiler.html">compiler tools</a></li>
<li><a href="../other.html"><b>other tools</b></a></li>
<li><a href="../extensions.html">extensions and kits</a></li>
<li><a href="../units.html">unit test tools</a></li>
</ul>
<h2>Other Tools</h2>
<ul>
<li><a href="../inblorb/index.html">inblorb</a></li>
<li><a href="../indoc/index.html">indoc</a></li>
<li><a href="../inpolicy/index.html">inpolicy</a></li>
<li><a href="../inrtps/index.html">inrtps</a></li>
</ul>
<h2>Foundation</h2>
<ul>
<li><a href="../../../inweb/docs/foundation-module/index.html">foundation</a></li>
</ul>
</nav>
<main role="main">
<!--Weave of 'M/ui' generated by 7-->
<ul class="crumbs"><li><a href="../webs.html">Source</a></li><li><a href="../other.html">Other Tools</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><p class="purpose">A very short guide to a very small program.</p>
<ul class="toc"><li><a href="#SP1">&#167;1. What Inpolicy is</a></li><li><a href="#SP3">&#167;3. Policies</a></li></ul><hr class="tocbar">
<p class="inwebparagraph"><a id="SP1"></a><b>&#167;1. What Inpolicy is. </b>Inpolicy is a command-line tool whose sole purpose is to help keep the
Inform 7 source code tidy. Unlike Inweb, Intest and Indoc, this tool
can't sensibly be used for any project other than Inform.
</p>
<p class="inwebparagraph">If you have compiled the standard distribution of the command-line tools
for Inform then the Inpolicy executable will be at <code class="display"><span class="extract">inpolicy/Tangled/inpolicy</span></code>.
Usage is very simple:
</p>
<pre class="display">
<span class="element">$</span><span class="plain"> </span><span class="functiontext">inpolicy/Tangled/inpolicy</span><span class="plain"> POLICY</span>
</pre>
<p class="inwebparagraph">where <code class="display"><span class="extract">POLICY</span></code> is whatever we want to check. There are very few at present;
in some ways this program is a placeholder for future tightening-up of the
style rules.
</p>
<p class="inwebparagraph"><a id="SP2"></a><b>&#167;2. </b>When it runs, Inpolicy needs to know where it is installed in the file
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>
<p class="inwebparagraph"></p>
<ul class="items"><li>(a) If the user, at the command line, specified <code class="display"><span class="extract">-at P</span></code>, for some path
<code class="display"><span class="extract">P</span></code>, then we use that.
</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.
</li><li>(c) Otherwise, if the environment variable <code class="display"><span class="extract">$INPOLICY_PATH</span></code> exists and is
non-empty, we use that.
</li><li>(d) And if all else fails, we assume that the location is <code class="display"><span class="extract">inpolicy</span></code>, with
respect to the current working directory.
</li></ul>
<p class="inwebparagraph">If you're not sure what Inpolicy has decided and suspect it may be wrong,
running Inpolicy with the <code class="display"><span class="extract">-verbose</span></code> switch will cause it to print its belief
about its location as it starts up.
</p>
<p class="inwebparagraph"><a id="SP3"></a><b>&#167;3. Policies. </b><code class="display"><span class="extract">-check-problems</span></code> makes a survey of (a) all of the Problem messages issued
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>
<pre class="display">
<span class="plain">1009 problem name(s) have been observed:</span>
<span class="plain">Problems actually existing (the source code refers to them):</span>
<span class="plain">906 problem(s) are named and in principle testable</span>
<span class="plain">81 problem(s) are 'BelievedImpossible', that is, no known source text causes them</span>
<span class="plain">14 problem(s) are 'Untestable', that is, not mechanically testable</span>
<span class="plain">8 problem(s) are '...', that is, they need to be give a name and a test case</span>
<span class="plain">Problems which should have test cases:</span>
<span class="plain">904 problem(s) have test cases</span>
<span class="plain">2 problem(s) have no test case yet:</span>
<span class="plain">PM_SuperfluousOf</span>
<span class="plain">PM_MisplacedFrom</span>
<span class="plain">Problems which are cross-referenced in 'Writing with Inform':</span>
<span class="plain">483 problem(s) are cross-referenced</span>
<span class="plain">All is well.</span>
</pre>
<p class="inwebparagraph">As this example report shows, small sins are forgiven.
</p>
<hr class="tocbar">
<ul class="toc"><li><i>(This section begins Manual.)</i></li><li><a href="M-rc.html">Continue with 'Reference Card'</a></li></ul><hr class="tocbar">
<!--End of weave-->
</main>
</body>
</html>