Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
walint
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
hub
walint
Commits
0682e115
Commit
0682e115
authored
3 years ago
by
stuebinm
Browse files
Options
Downloads
Patches
Plain Diff
documentation for URI rewrite rules
parent
2511c52d
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#8427
canceled
3 years ago
Stage: build
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Readme.md
+34
-9
34 additions, 9 deletions
Readme.md
with
34 additions
and
9 deletions
Readme.md
+
34
−
9
View file @
0682e115
...
...
@@ -39,19 +39,44 @@ walint --config-file config.json --repository path \
optional. Keys given here will override whatever values are set in the
configuration file.
##
#
Configuation
## Configuation
Take a look at
`config.json`
for an example. Most keys are required, and do not
have default values.
have default values.
In
`config.json`
, all possible keys are given.
For the schema, take a look at the definition of the
`LintConfig`
type in
`lib/LintConfig.hs`
; I'll attempt to remember documenting options there (if you
are unfamiliar with Haskell: key names come first, though there are all prepended
with
`config`
here. Types come after the
`::`
; ignore the
`HKD f`
bit and look
at whatever comes after that. Most types should be self-explanatory; Note that
you may leave out keys whose type includes
`Maybe`
)
Most options should be reasonably self-explanatory. Note that
`MaxLintLevel`
differs from the option
`--lintLevel`
: the latter merely determines what is
*printed*
(in case json output is not enabled), the former determines the
maximum lint level allowed before the linter rejects the map and does not
copy it to the path given to
`--out`
.
### Uri Schemas
### Output
`walint`
supports (limited) rewriting of URIs contained in the map json via
the
`UriSchemas`
option, which takes a map from uri schemas to a rule describing
what to do with such links, depending on the scope in which they appear.
`walint`
takes a very reductive view or URIs:
`schema://domain/tail`
#### Rewrite Rules
For now there are three types of such rules:
-
`schema: {"scope":[scopes]}`
: if in a scope listed in
`scopes`
, allow any
links of the given
`schema`
-
`schema: {"scope":[scopes], "allowed":[allowed], "blocked":[blocked], "prefix":prefix}`
:
if in a scope listed in
`scopes`
, prefix any URIs of the given
`schema`
with
the given
`prefix`
, unless the URI's domain occurs in
`allowed`
(in which case
leave it untouched), or it occurs in
`blocked`
, in which
case it will be rejected as a lint error.
-
`schema: {"scope":[scopes], "subst":{domain: prefix, ...}}`
: if in a scope
listed in
`scopes`
and given a URI with the domain
`domain`
, concatenate
`prefix`
with the tail of this URI. If there is no applicable
`domain`
,
reject the URI
For now there are two (useful) scopes:
`map`
applies to tiled map links
(i.e.
`exitUrl`
), and
`website`
applies to weblinks (i.e.
`openWebsite`
).
## Output
By default
`walint`
prints lints in a hopefully human-readable manner. Its exit
code will be 1 if the maximum lint level set in its config was exceeded, and 0
otherwise. Only in the latter case will it write out an adjusted map respository
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment