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

chore: Fix typos throughout codebase #15338

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

szepeviktor
Copy link

@szepeviktor szepeviktor commented May 10, 2024

Summary

Found few misspellings.

Checklist

  • No AI generated code was used in this PR

Please be gentle with me, I've gone through 500k lines.

@telegraf-tiger
Copy link
Contributor

Thanks so much for the pull request!
🤝 ✒️ Just a reminder that the CLA has not yet been signed, and we'll need it before merging. Please sign the CLA when you get a chance, then post a comment here saying !signed-cla

@powersj
Copy link
Contributor

powersj commented May 10, 2024

Hi,

I am AI robot 🙃

Please don't mess with the checklist. We do need that checked and accurate.

Also as the bot said, please do sign the CLA and let us know when you do.

Thanks

@szepeviktor
Copy link
Author

I am sorry.

@szepeviktor
Copy link
Author

please do sign the CLA and let us know when you do.

Submitted 🍏

@powersj
Copy link
Contributor

powersj commented May 10, 2024

!signed-cla

I am sorry.

No worries!

@powersj powersj changed the title Fix typos chore: Fix typos throughout codebase May 10, 2024
@telegraf-tiger telegraf-tiger bot added the chore label May 10, 2024
@powersj
Copy link
Contributor

powersj commented May 10, 2024

!signed-cla

Copy link
Contributor

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks @szepeviktor for your contribution and effort! Please do not change TOML tags as this will break compatibility to existing configurations, something we don't want to do. You should rather deprecate the misspelled config setting and add a new one (just like what is done in the "binary" parser)...

APICompatability bool `toml:"api_compatability"`
APICompatibility bool `toml:"api_compatibility"`
Copy link
Contributor

Choose a reason for hiding this comment

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

We cannot do this change as this breaks existing configs! Please deprecate the old option and add a new one...

return "Celcius"
return "Celsius"
Copy link
Contributor

Choose a reason for hiding this comment

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

We cannot do this unfortunately as this will break existing queries because the metric changes...

"tcmalloc_pageheap_committed_bytes": "TCMallocPageheapComittedBytes",
"tcmalloc_pageheap_committed_bytes": "TCMallocPageheapCommittedBytes",
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmm are we sure that the type is not in the output of MongoDB stats? Otherwise this will break the plugin...

TCMallocPageheapComittedBytes int64
TCMallocPageheapCommittedBytes int64
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here...

ServerDiagnotics bool `toml:"server_diagnotics"`
ServerDiagnostics bool `toml:"server_diagnostics"`
Copy link
Contributor

Choose a reason for hiding this comment

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

This will break existing configs. Please deprecate the old option and add a new one...

@@ -114,7 +114,7 @@ func processPingOutput(out string) (statistics, error) {
statsLine = stat.FindStringSubmatch(line)
}
if statsLine != nil && aproxs == nil {
aproxs = aprox.FindStringSubmatch(line)
aproxs = approx.FindStringSubmatch(line)
Copy link
Contributor

Choose a reason for hiding this comment

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

The array variable is also wrong, isn't it?

Endianess string `toml:"endianess" deprecated:"1.27.4;use 'endianness' instead"`
Endianness string `toml:"endianness" deprecated:"1.27.4;use 'endianness' instead"`
Copy link
Contributor

Choose a reason for hiding this comment

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

No! Actually this is to not break configs (i.e. what you should do for the other breaking config changes above), please leave this as-is!

Comment on lines 33 to 34
if p.Endianess != "" && p.Endianness == "" {
p.Endianness = p.Endianess
if p.Endianness != "" && p.Endianness == "" {
p.Endianness = p.Endianness
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here. This is to be compatible with old configs!

@srebhan srebhan self-assigned this May 13, 2024
@szepeviktor
Copy link
Author

szepeviktor commented May 13, 2024

@srebhan I am sorry. Reverting manually takes hours.
I am using typos, a Rust software.

Now I am starting over again based on your comments.

@szepeviktor
Copy link
Author

szepeviktor commented May 13, 2024

For the willing contributor: .typos.toml

[files]
extend-exclude = [
    ".git/",
    "go.mod",
    "go.sum",
    "CHANGELOG.md",
    "**/testcases/**",
    "**/testdata/**",

    "plugins/inputs/zfs/README.md",
]
ignore-hidden = false

[default]
extend-ignore-re = [
    "logical-ANDed",
    "\\$ecret-Passw0rd",
]

[default.extend-words]
"aproxs" = "approxs"

"aer" = "aer"
"bck" = "bck"
"iif" = "iif"
"oif" = "oif"
"pn" = "pn"
"rto" = "rto"
"siz" = "siz"
"wrk" = "wrk"
"endianess" = "endianess"
"mosquitto" = "mosquitto"
"splitted" = "splitted"

# Known typos
"celcius" = "celcius"
"compatability" = "compatability"
"diagnotics" = "diagnotics"
"uncorrect" = "uncorrect"

[default.extend-identifiers]
"TLS_RSA_WITH_3DES_EDE_CBC_SHA" = "TLS_RSA_WITH_3DES_EDE_CBC_SHA"
"TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA" = "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA"
"Ip6InECT0Pkts" = "Ip6InECT0Pkts"
"Ip6InECT1Pkts" = "Ip6InECT1Pkts"
"icmpInParmProbs" = "icmpInParmProbs"
"IcmpInParmProbs" = "IcmpInParmProbs"
"icmpOutParmProbs" = "icmpOutParmProbs"
"IcmpOutParmProbs" = "IcmpOutParmProbs"
"idel_per_s" = "idel_per_s"
"network_idel_per_s" = "network_idel_per_s"
# Known typos
"TCMallocPageheapComittedBytes" = "TCMallocPageheapComittedBytes"

# Typos
##"Github" = "GitHub"

@srebhan
Copy link
Contributor

srebhan commented May 14, 2024

@srebhan I am sorry. Reverting manually takes hours.
I am using typos, a Rust software.

Now I am starting over again based on your comments.

@szepeviktor why do you start over and why does it take hours? You just need to fix the few places I commented!?!?

@srebhan
Copy link
Contributor

srebhan commented May 14, 2024

@powersj maybe we could use the software mentioned to add a GitHub action for checking spelling?

@powersj
Copy link
Contributor

powersj commented May 14, 2024

@powersj maybe we could use the software mentioned to add a GitHub action for checking spelling?

I like this idea, but maybe not typos, a rust-based tool. Maybe misspell?

@szepeviktor
Copy link
Author

why does it take hours

Typos fixes typos. To revert a fix I have to search for each occurrence.

@srebhan
Copy link
Contributor

srebhan commented May 14, 2024

@szepeviktor you could manually correct the few occurrences in the git branch. No need to rerun the tool... Am I missing something?

@szepeviktor
Copy link
Author

szepeviktor commented May 14, 2024

The thing is typos work on the filesystem, not on git index.
So when you want to revert to "endianess" there are very many steps and they are error prone.

I've already redone everything.

@srebhan
Copy link
Contributor

srebhan commented May 15, 2024

@szepeviktor let me be clear. You do have the present git-branch leading to this PR... Now why can't you fire-up an editor with the branch checked out and manually revert the changes in the files I mentioned without running typos again? I don't see why this is a lot of work, it's just opening an editor and changing eight lines back to what they were before!?!?!?

@szepeviktor
Copy link
Author

szepeviktor commented May 15, 2024

When I work with typos the most of work is done by typos.
There is no "revert" function in typos, so I have to search git-diff-s to find all the lines where I have to revert a certain change.

@szepeviktor
Copy link
Author

BTW I do not write source code daily. I use an editor built into Midnight Commander.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants