summaryrefslogtreecommitdiff
path: root/crates/tor-config/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* Change deftly syntax to post 0.12.1 versionIan Jackson2024-06-171-1/+1
| | | | | | | | | | | * Change `pub` to `export` * Change the `=` in define to `:` * Change `pub_template_semver_check` to `template_export_semver_check` Right now, 0.12.1 supports both syntaxes. I have verified this branch also compiles with https://gitlab.torproject.org/Diziet/rust-derive-deftly/-/merge_requests/402 ee171ffaf56d7dcb7d75584054921153fe19b222
* Update to derive-deftly 0.12.1Ian Jackson2024-06-171-1/+1
| | | | | | * Bump in Cargo.toml * Deal with `${Xmeta as ...}` incompatible change, by always specifying an `as`, and changing `as tokens`.
* tor-config: Re-export serde_value.Gabriela Moldovan2024-06-031-0/+1
| | | | | We are about to need this in other crates (for generating the tests for the `NotAutoValue` implementations).
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* Convert tor-config to use figment.Nick Mathewson2024-04-221-6/+12
| | | | | There are probably ways to make this a bit more elegant, but at least the tests still pass.
* derive-deftly: Call pub_template_semver_checkIan Jackson2024-04-031-0/+2
| | | | | | | This is a new feature in d-d 0.10.0. Our currrent semver policy doesn't care about this, but let's not encode that property in the tree and leave ourselves a booby-trap.
* Switch to derive-deftlyIan Jackson2024-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the combination of a number of separate commits, many of which were generated by seddery, and then rebased and squashed. Cargo.toml perl -i~ -pe 's{^derive-adhoc}{derive-deftly = "0.10"}' crates/*/Cargo.toml (not regenerated during rebase) update Cargo.lock `cargo fetch` without --locked (regenerated during rebase) seddery git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{^use derive_adhoc}{use derive_deftly}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bdefine_derive_adhoc\b}{define_derive_deftly}g' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bAdhoc\b}{Deftly}g if m{derive}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\#\[derive_adhoc\b}{#[derive_deftly}g' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{use derive_adhoc}{use derive_deftly}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc\b}{derive_deftly_adhoc} if m{use.*deftly}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc!}{derive_deftly_adhoc!}' (not regenerated during rebase) Manually add `#[derive_deftly_adhoc]` where needed. seddery git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\#\[adhoc\b}{#[deftly}g' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc_template}{derive_deftly_template}' (not regenerated during rebase) Manually fix up an import Manually update some builder attrs Manually fix up tor_rtmock::time_core This was missed in my seddery, due to me rebasing the branch and not redoing the seddery.
* Merge branch 'encapsulate_config_rs' into 'main'Nick Mathewson2024-03-131-9/+30
|\ | | | | | | | | Encapsulate usage of config-rs inside tor-config. See merge request tpo/core/arti!2040
| * tor-config: Update documentation to not refer to config crate.Nick Mathewson2024-03-131-1/+1
| |
| * config: Remove From impls from config::ConfigErrorNick Mathewson2024-03-131-1/+1
| | | | | | | | These are another case of exposing the config crate.
| * tor-config: Put config::Config inside a wrapper type.Nick Mathewson2024-03-131-0/+16
| | | | | | | | This will let us replace Config with something better.
| * tor_config: Hide macro-only re-exports.Nick Mathewson2024-03-131-8/+13
| | | | | | | | | | Our macros use these exports, but we don't need everybody else to be able to see them.
* | Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|/
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* tor-config: flatten: always use field list from serdeIan Jackson2023-09-201-1/+1
| | | | | | | | This is a better trickery! Now we don't need to derive the list of field names at all. The test case becomes much simpler too, and no longer needs to compare field lists since we have only the serde field list.
* tor-config: flatten: Break out flattenable_extract_fieldsIan Jackson2023-09-201-1/+1
| | | | | | | | | This involves returning the field list in the `FlattenableTesterSuccess`. This leaves the names a little off; we'll update those at the end. Export this - it's going to replace the hidden pub test function.
* tor_config: Provide FlattenIan Jackson2023-09-201-0/+7
| | | | | This is an attempt to deal with the fact that `#[serde(flatten)]` is weirdly broken and doesn't work with `serde_ignored`.
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+2
|
* Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
| | | | Closes #950.
* lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
|
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* Disable clippy::unlinlined-format-argsNick Mathewson2023-01-271-0/+1
| | | | | | | | This warning kind of snuck up on us! (See #748) For now, let's disable it. (I've cleaned it up in a couple of examples, since those are meant to be more idiomatic and user-facing.) Closes #748.
* Fix typosDimitris Apostolou2023-01-071-1/+1
|
* test lint blocks: Do some semi-manuallyIan Jackson2022-12-121-1/+9
| | | | | | | 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.
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|
* cargo fmt to remove blank linesIan Jackson2022-10-121-1/+0
| | | | | | | Apparently cargo fmt doesn't like these, which my perl rune didn't delete. This commit is precisely the result of `cargo fmt`.
* Replace all README copies in src/lib.rs with includesIan Jackson2022-10-121-57/+1
| | | | | | | | The feature we want is `#[doc = include_str!("README.md")]`, which is stable since 1.54 and our MSRV is now 1.56. This commit is precisely the result of the following Perl rune: perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
* tor-config: Provide MultilineListBuilderIan Jackson2022-10-121-0/+1
| | | | This is what we'll use to parse the `bridges.bridges` config key.
* Improve error from bad escapes in a toml config.Nick Mathewson2022-08-251-1/+1
| | | | | | | | | | | | | | | | | 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.
* tor-config: Provide resolve_alternative_specsIan Jackson2022-08-251-0/+78
|
* tor-config: Introduce ResolutionResultsIan Jackson2022-08-251-1/+1
| | | | This will allow us to handle new kinds of warnigns etc.
* tor-config: Replace dir detection with ConfigurationSource enumIan Jackson2022-08-251-1/+1
| | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/682#note_2830860 And subsequent IRC discussion. Having done the work as per review comments, I don't much like the result. It's quite un-ergonomiuc. If we can't have fs autodetection, I think syntactic autodetection within sources.rs would be nearly as nice. However, I seem to be outvoted. At least the externally visible functionality (of an arti binary, say) is reasonably ergonomic.
* enable doc_auto_cfg feature on every crate when documenting for docs.rstrinity-1686a2022-08-241-0/+1
|
* tor-config: resolve_option_general: Add TODO about exampleIan Jackson2022-08-231-0/+5
|
* Fix syntax in doc comment.Nick Mathewson2022-08-231-1/+1
|
* tor-config: Provide resolve_option_general, for T: !Default etc.Ian Jackson2022-08-221-4/+43
| | | | | | | | | At one point in this MR I thought I was going to want this for arti::cfg::ListenConfig (which we don't want to be Default). In fact ListenConfig is being handled specially, but having written this function it seemed sensible to keep it. Since resolve_option becomes a wrapper for it, the existing tests exercise it.
* tor-config: Introduce PaddingLevelIan Jackson2022-08-161-0/+2
| | | | This will be used for controlling channel padding, for now.
* Run maint/add_warning crates/*/src/{lib,main}.rsIan Jackson2022-06-231-0/+3
| | | | Update all lint blocks
* impl_standard_builder: Allow for !DefaultIan Jackson2022-06-161-13/+54
|
* tor-config: impl_standard_builder: handle contexts with local ResultIan Jackson2022-06-161-1/+1
|
* config: Suppose that we might extend resolve_option to non-T::DefaultIan Jackson2022-06-101-0/+2
| | | | | As per point 3 in https://gitlab.torproject.org/tpo/core/arti/-/issues/488
* config: Do not strip_option for journald (and in future)Ian Jackson2022-06-101-0/+3
| | | | | As per point 1 in https://gitlab.torproject.org/tpo/core/arti/-/issues/488
* Fix typosDimitris Apostolou2022-06-051-2/+2
|
* tor-config: Fix a doc linkIan Jackson2022-06-011-1/+1
| | | | Nightly cargo doc complaints about this.
* Merge branch 'lint' into 'main'Ian Jackson2022-05-311-0/+3
|\ | | | | | | | | | | | | lints: Make lint blocks consistent and ensure they stay that way Closes #469 See merge request tpo/core/arti!557
| * lints: Add let_unit_value allow to all cratesIan Jackson2022-05-311-0/+1
| | | | | | | | | | From running add_warning, with manual picking of the right hunks/lines.
| * lints: Add lint block delimiters to every crateIan Jackson2022-05-311-0/+2
| | | | | | | | | | | | This was the result of: maint/add_warning crates/*/src/{lib,main}.rs and then manually curating the results.
* | tor-config: Suppress unwrap lint in testsIan Jackson2022-05-311-0/+1
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/546#note_2808892