Commit graph

18 commits

Author SHA1 Message Date
Matthias
005ce05c24
Trigger CI on push or pull request, but not both (#689)
See
https://github.community/t/how-to-trigger-an-action-on-push-or-pull-request-but-not-both/16662
for more info
2022-07-11 18:07:46 +02:00
Matthias
89106d11aa
Update rust.yml 2022-02-06 15:51:18 +01:00
faust
7353c8793b
Publish arm64 docker image (#406) 2021-12-01 09:58:32 +01:00
Matthias
251332efe2
Cache absolute_path to decrease allocations (#346)
* Cache `absolute_path` to decrease allocations

While profiling local file handling, I noticed that resolving paths was taking a
significant amount of time. It also caused quite a few allocations.
By caching the path and using a constant value for the current
directory, we can reduce the number of allocs by quite a lot.
For example, when testing on the sentry documentation, we do 50,4%
less allocations in total now. That's just a single test-case of course,
but it's probably also helping in many other cases as well.

* Defer to_string for attr.value to reduce allocs
* Use Tendrils instead of Strings for parsing (another ~1.5% less allocs)
* Move option parsing code into separate module
* Handle base dir more correctly
* Temporarily disable dry run
2021-10-05 01:37:43 +02:00
Matthias
5a2e10799f linting 2021-09-06 15:19:24 +02:00
Daniel Doubrovkine (dB.)
b3f90f925e
Use cargo-publish-all for release. (#312) 2021-09-06 01:07:56 +02:00
Daniel Doubrovkine (dB.)
f866abef61
Fix publish workflow (#309) 2021-09-04 01:49:29 +02:00
Matthias
96c80c3647 Add changes made by @dblock in #304 2021-09-03 19:18:39 +02:00
Lucius Hu
228e5df6a3
Major refactor of codebase (#208)
- The binary component and library component are separated as two
  packages in the same workspace.
  - `lychee` is the binary component, in `lychee-bin/*`.
  - `lychee-lib` is the library component, in `lychee-lib/*`.
  - Users can now install only the `lychee-lib`, instead of both
    components, that would require fewer dependencies and faster
    compilation.
  - Dependencies for each component are adjusted and updated. E.g.,
    no CLI dependencies for `lychee-lib`.
  - CLI tests are only moved to `lychee`, as it has nothing to do
    with the library component.
- `Status::Error` is refactored to contain dedicated error enum,
  `ErrorKind`.
  - The motivation is to delay the formatting of errors to strings.
    Note that `e.to_string()` is not necessarily cheap (though
    trivial in many cases). The formatting is no delayed until the
    error is needed to be displayed to users. So in some cases, if
    the error is never used, it means that it won't be formatted at
    all.
- Replaced `regex` based matching with one of the following:
  - Simple string equality test in the case of 'false positivie'.
  - URL parsing based test, in the case of extracting repository and
    user name for GitHub links.
  - Either cases would be much more efficient than `regex` based
    matching. First, there's no need to construct a state machine for
    regex. Second, URL is already verified and parsed on its creation,
    and extracting its components is fairly cheap. Also, this removes
    the dependency on `lazy-static` in `lychee-lib`.
- `types` module now has a sub-directory, and its components are now
  separated into their own modules (in that sub-directory).
- `lychee-lib::test_utils` module is only compiled for tests.
- `wiremock` is moved to `dev-dependency` as it's only needed for
  `test` modules.
- Dependencies are listed in alphabetical order.
- Imports are organized in the following fashion:
  - Imports from `std`
  - Imports from 3rd-party crates, and `lychee-lib`.
  - Imports from `crate::*` or `super::*`.
- No glob import.
- I followed suggestion from `cargo clippy`, with `clippy::all` and
  `clippy:pedantic`.

Co-authored-by: Lucius Hu <lebensterben@users.noreply.github.com>
2021-04-15 01:24:11 +02:00
Paweł Romanowski
fa9c5ea2cf
Run clippy for all targets, including tests (#93)
The test code should also be linted.
2021-01-03 16:41:19 +01:00
Matthias
3401999ccc
Publish releases on crates.io (#65) 2020-12-04 13:09:50 +01:00
Paweł Romanowski
96a92deffd Use more descriptive name for cargo test action 2020-10-16 14:47:54 +02:00
Paweł Romanowski
7bcf2de400 Actually run tests in GitHub actions 2020-10-16 14:38:05 +02:00
Paweł Romanowski
b2ada4746c Introduce cargo fmt and clippy checks, fix all clippy warnings 2020-10-16 14:35:38 +02:00
Xiaochuan Yu
65e8a40973
remove names 2020-10-14 19:19:14 -04:00
Xiaochuan Yu
292064ce90
Update rust.yml 2020-10-14 19:13:40 -04:00
Xiaochuan Yu
096b8756cb use action-rs Actions instead 2020-10-12 23:51:04 -04:00
Matthias
9a71b77bb2
Create rust.yml 2020-08-08 00:09:48 +02:00