Problem: base-noprelude is a non-standard dependency, unlike `base`.
Due to our use of `mixins` we don't need `base-noprelude` anymore,
we can just hide `Prelude`.
Solution: use `base` and hide `Prelude`.
Problem: `autoexporter` is used in one place to re-export one module.
Probably one day it will re-export more, but at this point it's really
overkill.
Moreover, it causes Hackage build to fail for the reasons mentioned
here:
https://github.com/haskell/hackage-server/issues/821
Solution: stop using it, re-export manually.
Problem: after we started using mixins feature, generated .cabal file
requires cabal 2.0. Attempt to upload our package to Hackage now reports
an error, saying that `autogen-modules` section have to mention `Path_*`
files.
Solution: add `Paths_xrefcheck` to `generated-other-modules` section of
`package.yaml`.
Problem: lootbox is not uploaded to hackage, so when we upload
xrefcheck, its build on hackage fails.
Solution: we can use `mixins` feature to set Universum as prelude
without any intermediate packages.
This seems to be supported even by quite old versions of stack, like
1.7.3, so that should not bring build problems in most cases.
Problem: I mistakenly imported `System.FilePath.Posix` everywhere,
it, as expected, is proper only on POSIX systems.
Solution: use just `System.FilePath`.
Problem: it's not good that `ignored` matches at file prefix, then if
someone marked `doc` folder as ignored, `doc-others` folder would be
ignored as well.
Solution: use exact matching. This requires user specifying
entries of `ignored` in specific format (e.g. `doc`, not `./doc`), but
let's don't bother about this for now.
Also, we already can ignore not only folders but also files, so we now
mention this in documentation.
Problem: I applied canonicalization to those files before attaching
repository root to them, this made relative filepaths expand as if they
counted from the current working directory. Since now we allow passing
custom root, this is invalid.
Solution: accept repository root, canonicalize only after it is
attached.
Problem: when launching our verifier with `-v`, visually separating
repository data section from found errors section is difficult.
Solution: make section headers more noticable.
Problem: it is often a case that in CI we copy xrefcheck repository into
the verified project, and we want to exclude folder with xrefcheck from
scan. Considering this in config is not too convenient, better add a CLI
option.
Solution: add this CLI option.
As in config, I call it `ignored`, because simpler `excluded` is too
general and it's not obvious what exactly it refers to - the set of
verified files or the set of supposedly non-existing files (in the
latter case references _to_ such files should also be prohibited).
Problem: we use many unusual unicode characters, on some locales this
may cause failures on attempt to print to stdout.
Solution: it is generally a good practice to set encoding of all
handlers to UTF-8, and this commit brings `with-utf8` package which does
that.
Problem: we are going to release this tool and from that point
it would be nice to maintain its changelog.
Solution: add a simple CHANGES.md and update PR template.
Problem: module names are prefixed with `Crv` which does not suit the
new project naming.
Solution: following the new `xrefcheck` name, rename modules so that
they start from `Xrefcheck`.
Problem: we use REUSE headers, but casual contributor may not know
anything about them, it makes it harder to contribute.
Solution: describe legal stuff in `CONTRIBUTING.md`.
Problem: nowadays we want all files to store licensing information in
machine-readable format and to use reuse tool to check that. But the
repo is not REUSE compliant.
Solution: add `LICENSES` folder and licensing information for each
file.
Problem: it was agreed with Kostya Ivanov that the copyright owner
is Serokell, so it should be updated in package.yaml.
Also it mentions incorrect license (the one in the repo is MPL-2.0)
and does not have license-file.
Solution: update `copyright` field and `license` field. Also add
`license-file`. Update maintainer as well, because now many people
from Serokell are involved.
I also took the liberty to fix the `github` field.
To support more different way to keep templates for issues and pull
requests.
Also I removed `docs/pull_request_template.md` because `docs` does not
seem to be the canonical choice for such files; if user needs to place
his files in such location, then he can adjust config correspondingly.