Skip to content

treefmt: init typos check#455924

Draft
qweered wants to merge 3 commits intoNixOS:masterfrom
qweered:treefmt-typos
Draft

treefmt: init typos check#455924
qweered wants to merge 3 commits intoNixOS:masterfrom
qweered:treefmt-typos

Conversation

@qweered
Copy link
Copy Markdown
Contributor

@qweered qweered commented Oct 26, 2025

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 6.topic: continuous integration Affects continuous integration (CI) in Nixpkgs, including Ofborg and GitHub Actions backport release-25.05 labels Oct 26, 2025
@mdaniels5757 mdaniels5757 added backport release-25.11 Backport PR automatically and removed backport release-25.05 labels Jan 2, 2026
@qweered qweered mentioned this pull request Feb 10, 2026
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 6.topic: haskell General-purpose, statically typed, purely functional programming language 6.topic: module system About "NixOS" module system internals 6.topic: lib The Nixpkgs function library and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Feb 10, 2026
@nixpkgs-ci nixpkgs-ci Bot added 8.has: documentation This PR adds or changes documentation 6.topic: policy discussion Discuss policies to work in and around Nixpkgs labels Feb 10, 2026
@qweered qweered force-pushed the treefmt-typos branch 3 times, most recently from 993cc29 to 6ed8582 Compare February 10, 2026 22:51
@qweered
Copy link
Copy Markdown
Contributor Author

qweered commented Feb 10, 2026

Ok so the process is pretty straightforward now, i dont expect architectural changes. i'll finish nixos directory and call it quits for now, pkgs directory may be enabled in future prs

@qweered qweered marked this pull request as ready for review February 10, 2026 22:52
Comment thread lib/strings.nix

```nix
stringAsChars (x: if x == "a" then "i" else x) "nax"
stringAsChars (x: if x == "h" then "n" else x) "hix"
Copy link
Copy Markdown
Contributor Author

@qweered qweered Feb 10, 2026

Choose a reason for hiding this comment

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

Renamed because of typos error

@nixpkgs-ci nixpkgs-ci Bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog This PR adds or changes release notes 8.has: module (update) This PR changes an existing module in `nixos/` 6.topic: hardware Drivers, Firmware and Kernels labels Feb 10, 2026
Comment thread ci/typos.toml
@@ -0,0 +1,72 @@
[default]
locale = "en"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We should aggree on this

Type: String (en, en-us, en-gb, en-ca, en-au)
Default: en
English dialect to correct to.

If set to en, words will be corrected to the closest spelling, regardless of which dialect that correction is part of.

@qweered qweered force-pushed the treefmt-typos branch 2 times, most recently from bab1de7 to 1f999cf Compare February 10, 2026 23:13
@qweered
Copy link
Copy Markdown
Contributor Author

qweered commented Feb 10, 2026

Very strange, nix fmt or nix develop --command treefmt doesnt show any errors locally

@sternenseemann
Copy link
Copy Markdown
Member

Blocking merges on minor misspellings doesn't make sense to me.

@RossComputerGuy
Copy link
Copy Markdown
Member

This seems trivial to have and is effectively another linter. Now, spelling isn't the most important thing in the world but it does scratch that itch that some people may have when they notice typos.

Copy link
Copy Markdown
Contributor

@SigmaSquadron SigmaSquadron left a comment

Choose a reason for hiding this comment

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

I feel like the downsides outweigh the benefits here. A large section of files are blocklisted by default, and another large section of files will need constant # typos: ignore-next-line comments that do nothing but clutter code. Having a separate config file hidden away in ci/ is also horrible UX for new contributors who happen to add a new file that has an unrecognised but correctly spelled noun in it.

Finally, I don't know if there's a tangible benefit for any of this. Most people using NixOS won't be reading the corrected code comments anyways. The only benefit I see from a typos linter is if it's restricted to option descriptions in nixos/modules, meta.{longD,d}escription attributes for packages and .md files in {,nixos/}doc, as that's where most people would see typos anyway.

@github-project-automation github-project-automation Bot moved this to In progress in Nixpkgs Lib Feb 11, 2026
@hsjobeki
Copy link
Copy Markdown
Contributor

I'm leaning towards the direction of @SigmaSquadron.
Let's enable typo checking where it matters most first.
That is documentation. Smallest subset being .md files.

We can extend that later to options and doc-comments, which also lands in documentation.

On the devX part there should be a good way to execute our linters locally.

@qweered
Copy link
Copy Markdown
Contributor Author

qweered commented Feb 21, 2026

Aggree, will think about ways how no implement that

@qweered qweered marked this pull request as draft February 21, 2026 13:47
@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: continuous integration Affects continuous integration (CI) in Nixpkgs, including Ofborg and GitHub Actions 6.topic: hardware Drivers, Firmware and Kernels 6.topic: haskell General-purpose, statically typed, purely functional programming language 6.topic: lib The Nixpkgs function library 6.topic: module system About "NixOS" module system internals 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: policy discussion Discuss policies to work in and around Nixpkgs 8.has: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. backport release-25.11 Backport PR automatically

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

6 participants