Skip to content
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

Add a tidy check that checks whether the fluent slugs only appear once #121860

Merged
merged 2 commits into from
Mar 10, 2024

Conversation

mu001999
Copy link
Contributor

@mu001999 mu001999 commented Mar 1, 2024

As @Nilstrieb said in #121828 (comment):

Might make sense to have a tidy check that checks whether the fluent slugs only appear once in the source code and lint for that
there's a tidy check already for sorting

We can get the tidy check error:

tidy check
tidy error: /path/to/rust/compiler/rustc_const_eval/messages.ftl: message `const_eval_invalid_align` is not used
tidy error: /path/to/rust/compiler/rustc_lint/messages.ftl: message `lint_trivial_untranslatable_diag` is not used
tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_invalid_literal_suffix` is not used
tidy error: /path/to/rust/compiler/rustc_infer/messages.ftl: message `infer_need_type_info_in_coroutine` is not used
tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_expr_not_allowed_in_context` is not used
tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_layout` is not used
tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_not_supported` is not used

r? @Nilstrieb

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 1, 2024
@bors
Copy link
Contributor

bors commented Mar 1, 2024

☔ The latest upstream changes (presumably #121859) made this pull request unmergeable. Please resolve the merge conflicts.

@mu001999 mu001999 force-pushed the master branch 4 times, most recently from 8105e5f to 976a5ca Compare March 2, 2024 01:15
Copy link
Member

@Noratrieb Noratrieb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a proper review of it, and I think the algorithm can be simplified. After that, happy to merge! I was surprised to see that the performance of it is still really good, not being slower than before.. I guess compute is just so cheap compared to (my quite fast!) disk :)

src/tools/tidy/src/fluent_alphabetical.rs Outdated Show resolved Hide resolved
src/tools/tidy/src/fluent_used.rs Outdated Show resolved Hide resolved
src/tools/tidy/src/fluent_used.rs Outdated Show resolved Hide resolved
src/tools/tidy/src/fluent_used.rs Outdated Show resolved Hide resolved
@Noratrieb
Copy link
Member

Awesome, thanks!
@bors r+

@bors
Copy link
Contributor

bors commented Mar 4, 2024

📌 Commit d88c7ff has been approved by Nilstrieb

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 4, 2024
jhpratt added a commit to jhpratt/rust that referenced this pull request Mar 5, 2024
Add a tidy check that checks whether the fluent slugs only appear once

As `@Nilstrieb` said in rust-lang#121828 (comment):
> Might make sense to have a tidy check that checks whether the fluent slugs only appear once in the source code and lint for that
there's a tidy check already for sorting

We can get the tidy check error:
```
tidy check
tidy error: /path/to/rust/compiler/rustc_const_eval/messages.ftl: message `const_eval_invalid_align` is not used
tidy error: /path/to/rust/compiler/rustc_lint/messages.ftl: message `lint_trivial_untranslatable_diag` is not used
tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_invalid_literal_suffix` is not used
tidy error: /path/to/rust/compiler/rustc_infer/messages.ftl: message `infer_need_type_info_in_coroutine` is not used
tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_expr_not_allowed_in_context` is not used
tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_layout` is not used
tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_not_supported` is not used
```

r? `@Nilstrieb`
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 5, 2024
Rollup of 15 pull requests

Successful merges:

 - rust-lang#121065 (Add basic i18n guidance for `Display`)
 - rust-lang#121202 (Limit the number of names and values in check-cfg diagnostics)
 - rust-lang#121213 (Add an example to demonstrate how Rc::into_inner works)
 - rust-lang#121262 (Add vector time complexity)
 - rust-lang#121287 (Clarify/add `must_use` message for Rc/Arc/Weak::into_raw.)
 - rust-lang#121664 (Adjust error `yield`/`await` lowering)
 - rust-lang#121838 (Use the correct logic for nested impl trait in assoc types)
 - rust-lang#121860 (Add a tidy check that checks whether the fluent slugs only appear once)
 - rust-lang#121913 (Don't panic when waiting on poisoned queries)
 - rust-lang#121959 (Removing absolute path in proc-macro)
 - rust-lang#121975 (hir_analysis: enums return `None` in `find_field`)
 - rust-lang#121978 (Fix duplicated path in the "not found dylib" error)
 - rust-lang#121987 (pattern analysis: abort on arity mismatch)
 - rust-lang#121993 (Avoid using unnecessary queries when printing the query stack in panics)
 - rust-lang#121997 (interpret/cast: make more matches on FloatTy properly exhaustive)

r? `@ghost`
`@rustbot` modify labels: rollup
@mu001999
Copy link
Contributor Author

mu001999 commented Mar 9, 2024

Is there anything wrong? Why hasn't this PR been merged yet 🤔

@Noratrieb
Copy link
Member

it's in the queue, weird.

jhpratt added a commit to jhpratt/rust that referenced this pull request Mar 9, 2024
Add a tidy check that checks whether the fluent slugs only appear once

As `@Nilstrieb` said in rust-lang#121828 (comment):
> Might make sense to have a tidy check that checks whether the fluent slugs only appear once in the source code and lint for that
there's a tidy check already for sorting

We can get the tidy check error:
```
tidy check
tidy error: /path/to/rust/compiler/rustc_const_eval/messages.ftl: message `const_eval_invalid_align` is not used
tidy error: /path/to/rust/compiler/rustc_lint/messages.ftl: message `lint_trivial_untranslatable_diag` is not used
tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_invalid_literal_suffix` is not used
tidy error: /path/to/rust/compiler/rustc_infer/messages.ftl: message `infer_need_type_info_in_coroutine` is not used
tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_expr_not_allowed_in_context` is not used
tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_layout` is not used
tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_not_supported` is not used
```

r? `@Nilstrieb`
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 9, 2024
Rollup of 12 pull requests

Successful merges:

 - rust-lang#99153 (Add Read Impl for &Stdin)
 - rust-lang#112136 (Add std::ffi::c_str module)
 - rust-lang#120504 (Vec::try_with_capacity)
 - rust-lang#121280 (Implement MaybeUninit::fill{,_with,_from})
 - rust-lang#121813 (Misc improvements to non local defs lint implementation)
 - rust-lang#121833 (Suggest correct path in include_bytes!)
 - rust-lang#121860 (Add a tidy check that checks whether the fluent slugs only appear once)
 - rust-lang#122160 (Eagerly translate `HelpUseLatestEdition` in parser diagnostics)
 - rust-lang#122178 (ci: add a runner for vanilla LLVM 18)
 - rust-lang#122186 (Remove a workaround for a bug)
 - rust-lang#122215 (Some tweaks to the parallel query cycle handler)
 - rust-lang#122223 (Fix typo in `VisitorResult`)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 9, 2024
Add a tidy check that checks whether the fluent slugs only appear once

As ``@Nilstrieb`` said in rust-lang#121828 (comment):
> Might make sense to have a tidy check that checks whether the fluent slugs only appear once in the source code and lint for that
there's a tidy check already for sorting

We can get the tidy check error:
```
tidy check
tidy error: /path/to/rust/compiler/rustc_const_eval/messages.ftl: message `const_eval_invalid_align` is not used
tidy error: /path/to/rust/compiler/rustc_lint/messages.ftl: message `lint_trivial_untranslatable_diag` is not used
tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_invalid_literal_suffix` is not used
tidy error: /path/to/rust/compiler/rustc_infer/messages.ftl: message `infer_need_type_info_in_coroutine` is not used
tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_expr_not_allowed_in_context` is not used
tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_layout` is not used
tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_not_supported` is not used
```

r? ``@Nilstrieb``
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 9, 2024
…iaskrgr

Rollup of 11 pull requests

Successful merges:

 - rust-lang#121567 (Avoid some interning in bootstrap)
 - rust-lang#121813 (Misc improvements to non local defs lint implementation)
 - rust-lang#121860 (Add a tidy check that checks whether the fluent slugs only appear once)
 - rust-lang#121907 (skip sanity check for non-host targets in `check` builds)
 - rust-lang#122160 (Eagerly translate `HelpUseLatestEdition` in parser diagnostics)
 - rust-lang#122178 (ci: add a runner for vanilla LLVM 18)
 - rust-lang#122186 (Remove a workaround for a bug)
 - rust-lang#122187 (Move metadata header and version checks together)
 - rust-lang#122215 (Some tweaks to the parallel query cycle handler)
 - rust-lang#122223 (Fix typo in `VisitorResult`)
 - rust-lang#122232 (library/core: fix a comment, and a cfg(miri) warning)

r? `@ghost`
`@rustbot` modify labels: rollup
@Nadrieril
Copy link
Member

@bors rollup

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 9, 2024
Add a tidy check that checks whether the fluent slugs only appear once

As `@Nilstrieb` said in rust-lang#121828 (comment):
> Might make sense to have a tidy check that checks whether the fluent slugs only appear once in the source code and lint for that
there's a tidy check already for sorting

We can get the tidy check error:
```
tidy check
tidy error: /path/to/rust/compiler/rustc_const_eval/messages.ftl: message `const_eval_invalid_align` is not used
tidy error: /path/to/rust/compiler/rustc_lint/messages.ftl: message `lint_trivial_untranslatable_diag` is not used
tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_invalid_literal_suffix` is not used
tidy error: /path/to/rust/compiler/rustc_infer/messages.ftl: message `infer_need_type_info_in_coroutine` is not used
tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_expr_not_allowed_in_context` is not used
tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_layout` is not used
tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_not_supported` is not used
```

r? `@Nilstrieb`
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 10, 2024
…iaskrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#121561 (Detect typos for compiletest test directives)
 - rust-lang#121567 (Avoid some interning in bootstrap)
 - rust-lang#121685 (Fixing shellcheck comments on lvi test script)
 - rust-lang#121833 (Suggest correct path in include_bytes!)
 - rust-lang#121860 (Add a tidy check that checks whether the fluent slugs only appear once)
 - rust-lang#121907 (skip sanity check for non-host targets in `check` builds)
 - rust-lang#122029 (When displaying multispans, ignore empty lines adjacent to `...`)
 - rust-lang#122221 (match lowering: define a convenient struct)
 - rust-lang#122244 (fix: LocalWaker memory leak and some stability attributes)
 - rust-lang#122251 (Add test to check unused_lifetimes don't duplicate "parameter is never used" error)

r? `@ghost`
`@rustbot` modify labels: rollup
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Mar 10, 2024
Add a tidy check that checks whether the fluent slugs only appear once

As ``@Nilstrieb`` said in rust-lang#121828 (comment):
> Might make sense to have a tidy check that checks whether the fluent slugs only appear once in the source code and lint for that
there's a tidy check already for sorting

We can get the tidy check error:
```
tidy check
tidy error: /path/to/rust/compiler/rustc_const_eval/messages.ftl: message `const_eval_invalid_align` is not used
tidy error: /path/to/rust/compiler/rustc_lint/messages.ftl: message `lint_trivial_untranslatable_diag` is not used
tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_invalid_literal_suffix` is not used
tidy error: /path/to/rust/compiler/rustc_infer/messages.ftl: message `infer_need_type_info_in_coroutine` is not used
tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_expr_not_allowed_in_context` is not used
tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_layout` is not used
tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_not_supported` is not used
```

r? ``@Nilstrieb``
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 10, 2024
…kingjubilee

Rollup of 10 pull requests

Successful merges:

 - rust-lang#112136 (Add std::ffi::c_str module)
 - rust-lang#113525 (Dynamically size sigaltstk in std)
 - rust-lang#121561 (Detect typos for compiletest test directives)
 - rust-lang#121685 (Fixing shellcheck comments on lvi test script)
 - rust-lang#121833 (Suggest correct path in include_bytes!)
 - rust-lang#121860 (Add a tidy check that checks whether the fluent slugs only appear once)
 - rust-lang#122125 (Revert back to Git-for-Windows for MinGW CI builds)
 - rust-lang#122221 (match lowering: define a convenient struct)
 - rust-lang#122251 (Add test to check unused_lifetimes don't duplicate "parameter is never used" error)
 - rust-lang#122264 (add myself to rotation)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 10, 2024
Add a tidy check that checks whether the fluent slugs only appear once

As ```@Nilstrieb``` said in rust-lang#121828 (comment):
> Might make sense to have a tidy check that checks whether the fluent slugs only appear once in the source code and lint for that
there's a tidy check already for sorting

We can get the tidy check error:
```
tidy check
tidy error: /path/to/rust/compiler/rustc_const_eval/messages.ftl: message `const_eval_invalid_align` is not used
tidy error: /path/to/rust/compiler/rustc_lint/messages.ftl: message `lint_trivial_untranslatable_diag` is not used
tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_invalid_literal_suffix` is not used
tidy error: /path/to/rust/compiler/rustc_infer/messages.ftl: message `infer_need_type_info_in_coroutine` is not used
tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_expr_not_allowed_in_context` is not used
tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_layout` is not used
tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_not_supported` is not used
```

r? ```@Nilstrieb```
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 10, 2024
…iaskrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#112136 (Add std::ffi::c_str module)
 - rust-lang#113525 (Dynamically size sigaltstk in std)
 - rust-lang#121685 (Fixing shellcheck comments on lvi test script)
 - rust-lang#121833 (Suggest correct path in include_bytes!)
 - rust-lang#121860 (Add a tidy check that checks whether the fluent slugs only appear once)
 - rust-lang#122125 (Revert back to Git-for-Windows for MinGW CI builds)
 - rust-lang#122221 (match lowering: define a convenient struct)
 - rust-lang#122244 (fix: LocalWaker memory leak and some stability attributes)
 - rust-lang#122251 (Add test to check unused_lifetimes don't duplicate "parameter is never used" error)
 - rust-lang#122264 (add myself to rotation)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 10, 2024
Add a tidy check that checks whether the fluent slugs only appear once

As ````@Nilstrieb```` said in rust-lang#121828 (comment):
> Might make sense to have a tidy check that checks whether the fluent slugs only appear once in the source code and lint for that
there's a tidy check already for sorting

We can get the tidy check error:
```
tidy check
tidy error: /path/to/rust/compiler/rustc_const_eval/messages.ftl: message `const_eval_invalid_align` is not used
tidy error: /path/to/rust/compiler/rustc_lint/messages.ftl: message `lint_trivial_untranslatable_diag` is not used
tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_invalid_literal_suffix` is not used
tidy error: /path/to/rust/compiler/rustc_infer/messages.ftl: message `infer_need_type_info_in_coroutine` is not used
tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_expr_not_allowed_in_context` is not used
tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_layout` is not used
tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_not_supported` is not used
```

r? ````@Nilstrieb````
jhpratt added a commit to jhpratt/rust that referenced this pull request Mar 10, 2024
Add a tidy check that checks whether the fluent slugs only appear once

As `````@Nilstrieb````` said in rust-lang#121828 (comment):
> Might make sense to have a tidy check that checks whether the fluent slugs only appear once in the source code and lint for that
there's a tidy check already for sorting

We can get the tidy check error:
```
tidy check
tidy error: /path/to/rust/compiler/rustc_const_eval/messages.ftl: message `const_eval_invalid_align` is not used
tidy error: /path/to/rust/compiler/rustc_lint/messages.ftl: message `lint_trivial_untranslatable_diag` is not used
tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_invalid_literal_suffix` is not used
tidy error: /path/to/rust/compiler/rustc_infer/messages.ftl: message `infer_need_type_info_in_coroutine` is not used
tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_expr_not_allowed_in_context` is not used
tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_layout` is not used
tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_not_supported` is not used
```

r? `````@Nilstrieb`````
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 10, 2024
…iaskrgr

Rollup of 14 pull requests

Successful merges:

 - rust-lang#112136 (Add std::ffi::c_str module)
 - rust-lang#113525 (Dynamically size sigaltstk in std)
 - rust-lang#121567 (Avoid some interning in bootstrap)
 - rust-lang#121642 (Update a test to support Symbol Mangling V0)
 - rust-lang#121685 (Fixing shellcheck comments on lvi test script)
 - rust-lang#121860 (Add a tidy check that checks whether the fluent slugs only appear once)
 - rust-lang#121942 (std::rand: enable getrandom for dragonflybsd too.)
 - rust-lang#122125 (Revert back to Git-for-Windows for MinGW CI builds)
 - rust-lang#122221 (match lowering: define a convenient struct)
 - rust-lang#122244 (fix: LocalWaker memory leak and some stability attributes)
 - rust-lang#122251 (Add test to check unused_lifetimes don't duplicate "parameter is never used" error)
 - rust-lang#122264 (add myself to rotation)
 - rust-lang#122269 (doc/rustc: Move loongarch64-unknown-linux-musl to Tier 3)
 - rust-lang#122271 (Fix legacy numeric constant diag items)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit fdcd051 into rust-lang:master Mar 10, 2024
11 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Mar 10, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 10, 2024
Rollup merge of rust-lang#121860 - mu001999:master, r=Nilstrieb

Add a tidy check that checks whether the fluent slugs only appear once

As ``````@Nilstrieb`````` said in rust-lang#121828 (comment):
> Might make sense to have a tidy check that checks whether the fluent slugs only appear once in the source code and lint for that
there's a tidy check already for sorting

We can get the tidy check error:
```
tidy check
tidy error: /path/to/rust/compiler/rustc_const_eval/messages.ftl: message `const_eval_invalid_align` is not used
tidy error: /path/to/rust/compiler/rustc_lint/messages.ftl: message `lint_trivial_untranslatable_diag` is not used
tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_invalid_literal_suffix` is not used
tidy error: /path/to/rust/compiler/rustc_infer/messages.ftl: message `infer_need_type_info_in_coroutine` is not used
tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_expr_not_allowed_in_context` is not used
tidy error: /path/to/rust/compiler/rustc_passes/messages.ftl: message `passes_layout` is not used
tidy error: /path/to/rust/compiler/rustc_parse/messages.ftl: message `parse_not_supported` is not used
```

r? ``````@Nilstrieb``````
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants