Libelektra: Unify Spelling

Created on 5 Sep 2016  ·  17Comments  ·  Source: ElektraInitiative/libelektra

Problem

At the moment ( 2e0b9d518a22a65ef3713db67d9f2eeac1580a4c ) there is no consistent usage of the word "metakey" within the repo.

  • "meta key" is used 103 times
  • "meta-key" is used 20 times
  • "metakey" is used 298 times

So "metakey" is the most popular variant.

Desired State

Consistent usage of the "metakey".

NOTE: Maybe other words and phrases are affected too. Please comment below.

Most helpful comment

But I would be glad if we can close this issue and sum this up in a file where we mention the definite way we write it, maybe with some usual misspellings…

I just created a file spelling.yaml with the following content:

# This file contains a list of often used words and common misspellings. Please
# always use the words at the root of this list (e.g. `key name` instead of
# `key-name` or `keyname`) if you write new documentation.

- basename
- cleanup
- command-line
- data type:
    misspellings:
      - data-type
      - datatype
- key name:
    misspellings:
      - key-name
      - keyname
- key value:
    misspellings:
      - key-value
      - keyvalue
- lookup
- metadata
- meta-value:
    misspellings:
      - metavalue
- mountpoint:
    misspellings:
      - mount-point
- startup
- timestamp

I removed words that were not part of my spelling dictionary in the list above (metaname and dirname). If someone wants to write a script using this definition in Ruby, the script should probably start with the following lines:

require 'YAML'

YAML.load_file 'spelling.yaml'

# Build regex (regex-escape misspelled words, join them with `|`) 
# Replace misspelled words in file

. The list of misspelled words above is a work-in-progress. Maybe someone of the other contributors can extend and correct the list.

All 17 comments

I think mountpoint / mount point is also affected (I never know how to write it, so I simply assume that).

Thank you for writing the proposal! I think we should go for the one-word variant, in long term popular words tend to this variant.

Note that doc/help/elektra-glossary.md is a good place to define how a word should be written and how it is meant.

Other words:
metaname
metavalue
metadata
basename
dirname
command-line
timestamp
startup
lookup
cleanup

Thanks for reporting! Should be fixed, the words are now written together.

What to do about key name and key value?

There are also constructs like metakey name.

for keyname a quick n dirty check gave me the following results:

grep -r -i 'keyname' ./* | wc -l
    3878
grep -r -i 'key-name' ./* | wc -l
     237
grep -r -i 'key name' ./* | wc -l
    1275

and the results for key value

grep -r -i 'key value' ./* | wc -l
     435
grep -r -i 'keyvalue' ./* | wc -l
    1093
grep -r -i 'key-value' ./* | wc -l
      25

@markus you said in a pullrequest "Please use key-?name consistently" so i assume we use the key-name variant in that case? or use keyname as in this issue you suggested using the variant where the words are written together (seems to be used very often throughout all files, but not that much in the documentation, i guess thats because of variables being called keyname or keyName similar?)

Thanks for looking at it! For the PR pick anything, but keep consistent within the PR. Let us discuss it in the next meeting which name we choose for whole Elektra. Maybe we should even use key instead of keyname which is much more standard.

"key name" because "keyname" has another meaning, so we will also use "key value" or "value"

datatype, data-type -> "data type"

Since you wrote we should join the discussion here: Are there any other words left where it is not clear which spelling we should use?

I had the impression there are. In particular I thought the non-standard way we use "key" for is worth consideration. But I would be glad if we can close this issue and sum this up in a file where we mention the definite way we write it, maybe with some usual misspellings or ideally we even write a small script to automatically fix regressions.

But I would be glad if we can close this issue and sum this up in a file where we mention the definite way we write it, maybe with some usual misspellings…

I just created a file spelling.yaml with the following content:

# This file contains a list of often used words and common misspellings. Please
# always use the words at the root of this list (e.g. `key name` instead of
# `key-name` or `keyname`) if you write new documentation.

- basename
- cleanup
- command-line
- data type:
    misspellings:
      - data-type
      - datatype
- key name:
    misspellings:
      - key-name
      - keyname
- key value:
    misspellings:
      - key-value
      - keyvalue
- lookup
- metadata
- meta-value:
    misspellings:
      - metavalue
- mountpoint:
    misspellings:
      - mount-point
- startup
- timestamp

I removed words that were not part of my spelling dictionary in the list above (metaname and dirname). If someone wants to write a script using this definition in Ruby, the script should probably start with the following lines:

require 'YAML'

YAML.load_file 'spelling.yaml'

# Build regex (regex-escape misspelled words, join them with `|`) 
# Replace misspelled words in file

. The list of misspelled words above is a work-in-progress. Maybe someone of the other contributors can extend and correct the list.

namespace seems to be clear-cut, it only occurs separated within gtest.

As suggested by @sanssecours, we should use Elektra’s instead of Elektra's or Elektras.

I started with an implementation of automatic spelling fixes using sed.

Should we use british or american spelling? Any opinions on that?

diff --git a/scripts/sed b/scripts/sed
index 322463d..67b0770 100644
--- a/scripts/sed
+++ b/scripts/sed
@@ -5,6 +5,8 @@ s/\<meta-name\>/metaname/g
 s/\<meta value\>/metavalue/g
 s/\<meta-value\>/metavalue/g

+s/\<behaviour\>/behavior/g
+
 # s/\<dir name\>/dirname/g
 # s/\<base name\>/basename/g

As discussed we will use american spelling

I think we can close this now, the spelling now has improved and the sed script exists and is maintained.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

markus2330 picture markus2330  ·  49Comments

markus2330 picture markus2330  ·  585Comments

markus2330 picture markus2330  ·  62Comments

kodebach picture kodebach  ·  29Comments

sanssecours picture sanssecours  ·  57Comments