| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
This commit executes maint/add_warning with the just added change to
deny string slices except in tests.
I recommend auditing this by checking out the previous commit followed
by running the script yourself and then verifying that the diff is
identical to this commit.
This commit makes cargo clippy fail. We will add exceptions in the next
commit.
|
| | |
|
| |
|
|
|
|
|
|
| |
Some of the tests used derive(Builder), which is not current
practice for our configuration.
Additionally, they didn't implement the requisite ConfigBuilder
logic to pass with the other changes in this branch.
|
| |
|
|
|
|
|
| |
I've left the options here as booleans, but moved them into a
struct. (IMO, booleans are at their riskiest when they are passed
as function arguments, and much less risky when they are used as
struct fields.)
|
| |
|
|
|
|
| |
This functionality exposes the part of the configuration tree that
was actually used, along with any defaulted values. RPC will want
this.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This new method modifies a builder by replacing any unset values
that have a default with that default. We're using this method
so that we can re-serialize a builder into a `ConfigurationTree`
with all of its default values included.
In all cases, `b.apply_defaults()?; b.build()` should produce
the same output as `b.build()`.
The interesting parts of this commit are in tor_config::load
and tor_config::derive. The rest of this commit just adds
`apply_defaults` to other builders that _aren't_ made with
`derive_deftly(TorConfig)`.
|
| |
|
|
| |
It previously referred to a function that didn't exist.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
This trait will be implemented by every type that our
derive_deftly(TorConfig) template generates. It will, among other
things, help us figure out the Builder type for a given config type
in cases where string-pasting magic is intractable, or where we
want to use assert_not_impl to double-check the attributes.
|
| |
|
|
| |
Run maint/add_warning
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
First, run
```
git grep -l "^edition =" |
xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;'
```
Second, manually verify that all Cargo.toml files have changed,
and nothing else has changed.
Third, run cargo fmt again.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
```text
warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator
--> crates/tor-config/src/load.rs:606:18
|
606 | .last()
| ^^^^^^ help: try: `next_back()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last
note: the lint level is defined here
--> crates/tor-config/src/lib.rs:9:9
|
9 | #![warn(clippy::all)]
| ^^^^^^^^^^^
= note: `#[warn(clippy::double_ended_iterator_last)]` implied by `#[warn(clippy::all)]`
```
|
| |
|
|
|
|
|
| |
The new (dubiously named) `Figment::extract_lossy` method
can treat decode numbers from strings, and booleans from numbers or
strings. This makes the behavior compatible with config-rs, and
should (I hope) finally allow us to migrate.
|
| |
|
|
|
| |
There are probably ways to make this a bit more elegant, but at
least the tests still pass.
|
| |\
| |
| |
| |
| | |
Encapsulate usage of config-rs inside tor-config.
See merge request tpo/core/arti!2040
|
| | | |
|
| | |
| |
| |
| | |
These are another case of exposing the config crate.
|
| | |
| |
| |
| | |
This will let us replace Config with something better.
|
| | | |
|
| |/ |
|
| | |
|
| | |
|
| |
|
|
|
| |
This panics on error, and we're fine with a panic on misbehavior in
tests.
|
| |
|
|
|
|
|
| |
This is the hunks from running the rune in maint/adhoc-add-lint-blocks
but which require some subsequent manual fixup: usually, deleting
now-superfluous outer allows, but in some cases manually putting back
lints that the adhoc script deleted.
|
| |\
| |
| |
| |
| | |
Remove `anyhow` from `tor-config` crate
See merge request tpo/core/arti!707
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
And linkify it.
|
| |/ |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Whereas previously we would say:
```
target/debug/arti: error: invalid escape character in string: `Z` at line 9 column 14 in ../../.config/arti/arti.toml
```
we now say:
```
target/debug/arti: error: invalid escape character in string: `Z` at line 9 column 14 in ../../.config/arti/arti.toml (If you wanted to include a literal \ character, you need to escape it by writing two in a row: \\)
```
The implementation is a bit of a hack, I'm afraid, but I don't think
it's all that bad.
Closes #549.
|
| | |
|
| |
|
|
| |
This will allow us to handle new kinds of warnigns etc.
|
| |
|
|
| |
We're going to want the to use the same type for deprecated keys.
|
| | |
|
| |
|
|
| |
This is one I missed earlier.
|
| | |
|
| |\
| |
| |
| |
| | |
Add a few coverage-based tests to tor-config.
See merge request tpo/core/arti!540
|
| | |
| |
| |
| | |
There's nothing major here, but it does fill in a few gaps.
|
| |/ |
|
| |
|
|
| |
We can have mem::take, hooray.
|
| |
|
|
|
| |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/529#note_2807331
|
| |
|
|
|
|
|
| |
This was a slip.
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/529#note_2807330
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
This makes the function a tiny bit clearer.
|
| |
|
|
|
| |
This is not a doc comment because we don't want it to be public: it
must refer to private fields, etc.
|
| | |
|