Commit Graph

41 Commits

Author SHA1 Message Date
Ivan Gromakovskii
64a338b567
[Chore] Incorporate Scarf (#281)
Problem: we'd like to get some statistics about our users, so that
we know how many people use `xrefcheck` or at least view its README,
from what OS they do it, etc.

Solution:
There is a tool called [Scarf](https://about.scarf.sh/) that
can be used for this purpose.

1. Create a Docker package in Scarf which acts as a proxy,
so that instead of `docker pull serokell/xrefcheck` one will use
`docker pull serokell.docker.scarf.sh/serokell/xrefcheck` and
Scarf will automatically record some (anonymyzed) data.

2. Create a File package in Scarf which acts as another proxy.
It downloads artifacts from GitHub releases, e. g.:
https://serokell.gateway.scarf.sh/xrefcheck/v0.2.2/xrefcheck-x86_64-linux

3. Mention these links in usage instructions.

4. Add a tracking pixel to README to also get statistics about
README views.
2023-07-06 18:34:05 +06:00
Philipp Herzog
40a2451105
[Chore] Replace buildkite ci with github-actions 2023-06-21 11:49:32 +02:00
Adrián Enríquez
eccb6d0068
[#25] Handle 304 redirect
Problem: After recent work on Xrefcheck redirect behavior, it remained
to discuss how to handle 304 redirects.

Solution: With the current default configuration, 304 redirects are
considered as valid, which seems appropriate taking into account that
304 responses usually mean that you previously received a successful
response for that same request and there is no need to retransmit the
resource again. We add a test case for this default config and update
the FAQ section.
2023-01-16 18:51:59 +01:00
Adrián Enríquez
05fe537ae1
[Chore] Simplify regexp usages 2022-12-30 17:12:16 +01:00
Adrián Enríquez
0b4ce991a1
[#25] Redirect links with configuration rules
Problem: We previously changed the default behaviour of Xrefcheck when
following link redirects, but did not provide a way to configure it.

Solution: We are adding a new field in the configuration file to allow
writing a list of redirect rules that will be applied to links that
match them.
2022-12-30 17:11:01 +01:00
Adrián Enríquez
e8d79e7f14
[#211] Case insensitive anchors
Problem: Some Markdown flavours such as the GitHub one are case
insensitive regarding anchors, but our analysis is currently
case sensitive and it produces false positives.

Solution: Support case-insensitivity depending on the configured
Markdown flavour. Apply this also to ambiguous and similar anchors
detection.
2022-12-13 10:20:32 +01:00
Adrián Enríquez
9c5f5f82b7
[#218] Change redirects default behaviour
Problem: Xrefcheck currently always follows redirect links.

Solution: We are changing its default behaviour regarding redirect
links to fail and report permanent redirects, and to pass for temporary
redirects. Further PRs will allow the user to configure other policies.
2022-12-12 10:19:01 +01:00
Adrián Enríquez
d41a07e7bc
[#202] Remove poorly supported unicode symbols from the program output
Problem: We are using unicode symbols as visual clues in the program output that are not commonly supported and are therefore not always displayed as intended.

Solution: Remove the usage of these symbols, as the program output is already using other visual clues and the result will remain understandable for the user.
2022-12-01 09:47:51 +01:00
Anton Sorokin
fb77575b0b
[#164] Add workflow for running Windows tests on CI
Problem: we are not testing behavior of xrefcheck on Windows

Solution: and add workflow to run
golden and tasty tests on CI
via github-actions windows runner
Some subproblems appear:

1.
Problem: CI build fails beacuse it needs `pcre` package
Solution: add it (somehow), see `install pacman dependencies`
in ci.yml

2.
Problem: Network errors displayed different on different platforms
Solution: collect output from both and use
`assert_diff expected_linux.gold || assert_diff expected_windows.gold`

3:
Problem: "Config matches" test is failing because checkout action
clone files with CRLF, and test assert equality of two ByteStrings
Solution: manually remove CR
2022-11-30 21:00:58 +02:00
Diogo Castro
2fd11bfeb1
[#147] Improve readme
Improved the readme and fixed several problems:
* Mention support for GitLab - this is important and wasn't mentioned
  anywhere.
* Add a FAQ clarifying how xrefcheck behaves in some important
  situations.
* We don't need to get into a lot of detail about the syntax of the
  `xrefcheck: ignore` annotations, where they're allowed and where
  they're not. A general idea and a couple of examples are more than
  enough.
* Added the backlink `[↑](#xrefcheck)` where it was missing.
* Fixed inconsistent level headers: we we're using `###` where we should
  be using `##`
* `nix run` should now be `nix shell`
* Add a link to `tests/configs/github-config.yaml` which contains a list
  of all supported config options.
* Instead of mentioning GitHub Actions in the "usage" section and nix in
  a separate section, mention everything in the "usage" section.
* Fixed link to `stack2cabal`
* Fixed typos and rephrased some bits.
2022-11-18 11:39:02 +00:00
Anton Sorokin
23b52729b1
[#169] Rename ignore file annotation to ignore all
Problem: as in #169, `ignore file` annotation is ignoring
not file itself but all links at file, which is not obvious

Solution: rename it to `ignore all`

Also renamed `IMFile :: IgnoreMode` and `IMSFile :: IgnoreModeState`
to `IMAll` and `IMSAll`
2022-10-26 11:31:52 +03:00
Sergey Gulin
bfbe20a5b0
[#139] Ignore build-related files
Problem: At the moment, we're using the ignored option for mainly 2
purposes: 1) to ignore all files in the `.git` folder (`.git/**/*`) to
ignore all build-related temporary files (the default config ignores
`.stack-work/**/*`). A more robust alternative might be to ignore all
files implicitly ignored by git.

Solution: Use `git ls-files` to ignore all files implicitly ignored by git.
2022-10-21 22:07:00 +10:00
Sergey Gulin
332da5569e
[#77] Add support for glob patterns to ignored and notScanned
Problem: The `virtualFiles` config option supports glob patterns. On the
other hand, `ignored` only supports exact matches and `notScanned`
mathches on prefixes. There is also a bug where `ignored` does not
ignore files if they contain broken xrefcheck annotations.

Solution: Add support for glob patterns to `ignored` and
`notScanned`. Filter ignored files before parsing their contents.
2022-09-08 22:49:27 +10:00
Sergey Gulin
397f23c9da
[#126] Remove note ignoreRefs is optional from README
Problem: We made `ignoreRefs` a required option. But the `README.md`
still contains a note that `ignoreRefs` is optional.

Solution: Remove the note that says `ignoreRefs` is optional.
2022-08-29 17:26:35 +10:00
Andrey Demidenko
c67ee9bd52
[#47] Handle ftp links
Problem:
Currently we support only http and https links. If there is an `ftp://`
link, you will get exception.

Solution:
Use `ftp-client` to check connection to ftp, see response statuses and
check file existence. This produces adding new error types and small
refactoring.
Provide a test which is separate executable, where we have to pass CLA -
ftp host.

Co-authored-by: Alexander Bantyev <alexander.bantyev@serokell.io>
2021-10-08 13:59:14 +03:00
Andrey Demidenko
5b6308982c
Add note about cabal usage
Problem:
I've met problem with one package version. I use cabal to build project and cabal for some reason decided to use old version of this package. With stack everything fine.
So, I think not only me, but other people prefer cabal over stack.

Solution:
Add note to our README.md that in case of cabal usage it's required to run `stack2cabal` first.
Also ignore all cabal staff so it can't be accidentally added to repo.
2021-07-22 10:06:55 +03:00
martoon
045f4146cf
[#55] Generate config depending on the repo type
Problem: now when we include repository type into the config, it seems
to make sense to generate config differently depending on the repository
type. Especially taking into account that currently in some fields we
mix GitHub and GitLab -specific contents.

Solution:

Leave placeholders in the default config and later fill them from the
code depending on the required repository type.

Add a mandatory repository type parameter to `dump-config` CLI command.

Along with a test checking for config validity, add a golden test on the
produced config so that we could assess how sane it looks like.
2021-05-03 17:01:20 +03:00
Zhenya Vinogradov
69f45d769a
Remove trailing whitespace everywhere 2021-03-11 14:47:34 +03:00
Alyona Antonova
e888ef5813 [#135] Add information about external links ignoring to the README.md
Problem: Added ignoring features need to
be described somewhere to be visible
for users.

Solution: Add such a description to the
`Usage` part of `README.md`
2021-03-09 22:18:07 +03:00
martoon
94836bc054
Update README section with comparison
Problem: there seems to be another popular tool for HTMLs verification
called `linkcheck`, it is stated to be way better than
`broken-link-checker`.

Solution: replace `broken-link-checker` mention with `linkcheck`, say
that there are other solutions to this problem.

Also make the paragraph a bit more clear in general.
2021-01-08 15:21:25 +03:00
martoon
07757f2754
Mention our GitHub action in README
Problem: @gromakovsky has recently implemented a github action which
adds xrefcheck pass to CI and it resides in a separate repository, we
want it to be visible in our documentation here.

Solution: mention it in `Usage` section.
2020-09-17 14:03:38 +03:00
Alexander Bantyev
3dbff2ca93
Add ways to get xrefcheck to readme 2020-06-29 17:49:30 +03:00
Alexander Bantyev
7b9804ff61
Update README to reflect updated haskell.nix version 2020-02-18 17:34:23 +03:00
martoon
fd949bc3c8
Rename the project to xrefcheck
Problem: the previous name `crossref-verifier` was found long and
boring.

Solution: rename to `xrefcheck`.
2020-01-14 12:17:01 +03:00
Ivan Gromakovskii
8060c7187b
[INT-128] Make the repository REUSE compliant
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.
2019-12-19 16:19:27 +03:00
NaeosPsy
ead4f7b65f
Resolving comments 2019-12-18 14:49:37 +02:00
NaeosPsy
d2ab93b6e4
Making readme more readable & typo-free 2019-12-18 11:44:03 +02:00
martoon
5e397495c3
Change issues tracker
Problem: YT is currently private, we'd better use GitHub issues.
2019-12-17 13:41:05 +03:00
martoon
21964d27ca
Improve Usage section 2019-12-17 13:41:05 +03:00
martoon
f928522b59
Add some sections to README
* Motivation
* Aims
* Comparison with other solutions
* Configuring
2019-12-17 13:41:05 +03:00
martoon
af9fd8fcc2
Hide nix section of README under spoiler
Such details can prevent user from reaching "build" and "use" sections.
2019-12-17 13:41:05 +03:00
martoon
d280993076
Add picture with output sample in README 2019-12-17 13:41:05 +03:00
martoon
4fa2f6f9a9
Update promo in README 2019-12-17 13:41:05 +03:00
martoon
d4e6b0363b
Add build status badge 2019-12-17 13:41:05 +03:00
Alexander Bantyev
87cf89de2e
Don't build tests in external projects 2019-12-09 14:41:03 +03:00
Ivan Gromakovskii
482e9b2684
Write some notes about CI in README
Problem: CI uses some temporary workarounds, one may wonder whether
they are necessary and not get an answer.

Solution: write about it in README.
2019-12-05 00:00:41 +03:00
martoon
44f6008228
Use full scan by default
Initially the primary use case for this tool in my point of view was
repeated runs for a repository until documentation is valid, thus I've
set checking only local refs as default behaviour (checking external
refs takes way longer).
Another motivation was that I expected CI to have one mandatory job for
local scan and one optional for remote refs scan.

Now I think that there are more reasons to perform full scan by default.
* It occured that in CI we usually want to have all checks optional, so
  that someone could temporarily break links on purpose (e.g. in case
  of mutually-dependent pull requests).
* First impression is important, and we want to demostrate all the
  features of the tool in default run.
* If use case mentioned in the very top actually takes place, one can
  add the necessary option, that's fine.
2019-12-03 23:24:57 +03:00
martoon
0671986bcb
Make providing config optional
Problem: currently `crossref-verify` executable does not work without
configuration, and user was supposed to use one from the repository if
he does not have its own. This is very inconvenient.

Solution: make executable remember some config and use it by default.
2019-12-03 23:19:37 +03:00
martoon
ad1ccccad7
Add README and other required meta files 2019-03-14 20:29:36 +03:00
martoon
ea83f75643
[INT-31] Implement cross-references verifier 2018-10-11 02:51:28 +03:00
Konstantin Ivanov
44d735c607
Initial commit 2018-09-21 20:02:19 +03:00