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

Specify units on all flags and config settings #629

Open
josebolos opened this issue Mar 21, 2022 · 0 comments
Open

Specify units on all flags and config settings #629

josebolos opened this issue Mar 21, 2022 · 0 comments

Comments

@josebolos
Copy link
Member

josebolos commented Mar 21, 2022

A source of errors that may be relatively common but hard to debug is assuming the (wrong) units for a specific input. For example, the timeout value in pa11y is specified in milliseconds, but people more familiar with other programming languages may assume that the timeout is specified in, say, seconds instead.

These errors may be tricky to debug, specially if they are related to time units.

I propose we modify all settings and config items so the units are always part of the name of the setting, configuration option, or function input.

The way forward would probably be something like:

  • Add the new settings/options as an alternative/alias to the existing one (Current MAJOR version)
  • Mark the unit-less options as deprecated (Version MAJOR + 1)
  • Remove the unit-less options (Version MAJOR + 2)

A nice reference, with examples of the problems and ways around it:
https://ruudvanasseldonk.com/2022/03/20/please-put-units-in-names

An alternative for functions (we may not need this in this case):
https://afontcu.medium.com/cool-javascript-9-named-arguments-functions-that-get-and-return-objects-337b6f8cfa07

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

No branches or pull requests

2 participants