-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[107049] Recognise top level keys in config.toml.example #108229
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon. Please see the contribution instructions for more information. |
@@ -459,12 +465,23 @@ def configure_section(lines, config): | |||
raise RuntimeError("failed to find config line for {}".format(key)) | |||
|
|||
|
|||
for section_key in config: | |||
section_config = config[section_key] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed this and used <dict>.items()
instead.
src/bootstrap/configure.py
Outdated
raise RuntimeError("config key {} not in sections".format(section_key)) | ||
def configure_top_level_key(lines, top_level_key, value): | ||
for i, line in enumerate(lines): | ||
if line.startswith('#' + top_level_key + ' = ') or line.startswith(top_level_key + ' = '): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
account for commented and uncommented top-level key-values
src/bootstrap/configure.py
Outdated
section_config = config[section_key] | ||
if section_key not in sections: | ||
raise RuntimeError("config key {} not in sections".format(section_key)) | ||
def configure_top_level_key(lines, top_level_key, value): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
decided not to overload configure_section()
This comment has been minimized.
This comment has been minimized.
Noob here, any lints I can run to autoformat the configure.py code? Or do I have to fix it manually? @jyn514 / @zephaniahong |
@lionellloh you could run |
I am seeing this in the CI:
Is that just a warning? |
@lionellloh There a tool called tidy that enforces some formatting: https://rustc-dev-guide.rust-lang.org/tests/intro.html?highlight=tidy#tidy |
@jyn514 Are you okay with running black? Because the last time I made a PR for a python file (and was formatted by some formatter), I was told to undo the formatting. |
Awesome, that's what I am looking for! |
That's probably because of what you did when testing out your profile = "compiler"
changelog-seen = 2 If you look at the error, its trying to find a file called The profile dictates the file to look for. In this case, by changing it to |
@lionellloh Once your tests pass, do squash your commits. |
Sure! Any comments on the PR? |
I'll leave that to the reviewer since I'm still relatively new to this. Just wanted to help you reach a point where it'd be easier for your reviewer!(: But FWIW, it looks good to me! |
Also, if you're interested, you could consider working on #107050 as its closely related to this issue. You might want to check if the current assignee is still interested in working on it though. |
r? @jyn514 |
I don't think Jyn is free to review PRs. Usually, give the reviewer about 2 weeks. If you don't get a response, then do ping your reviewer. Alternatively, you can join the Zulip channel as sometimes reviewers are more active there. |
@bors r+ rollup |
Thanks everyone! I am keen to contribute more. Feel free to assign more issues to me. I will look at #107050 next |
…mpiler-errors Rollup of 7 pull requests Successful merges: - rust-lang#105736 (Test that the compiler/library builds with validate-mir) - rust-lang#107291 ([breaking change] Remove a rustdoc back compat warning) - rust-lang#107675 (Implement -Zlink-directives=yes/no) - rust-lang#107848 (Split `x setup` sub-actions to CLI arguments) - rust-lang#107911 (Add check for invalid #[macro_export] arguments) - rust-lang#108229 ([107049] Recognise top level keys in config.toml.example) - rust-lang#108333 (Make object bound candidates sound in the new trait solver) Failed merges: - rust-lang#108337 (hir-analysis: make a helpful note) r? `@ghost` `@rustbot` modify labels: rollup
This doesn't actually work.
I think you need to call |
Hey sorry yeah do assign it to me. I can take a look and fix it. |
Closes #107049
Test Plan
Configure changelog-seen
Configure profile