docs: update CONTRIBUTING.md (#2476)

* docs: fix outdated section name

* docs: improve grammar

* docs: make `lf` stand out

* docs: add guidance for proposing new features

* docs: improve punctuation
This commit is contained in:
CatsDeservePets authored and GitHub committed 2026-03-29 01:02:47 +01:00
1 parent c5c3de643e
commit a966b1387c
1 file changed
+14 -8
+14 -8
View File
@@ -1,8 +1,14 @@
# Contributing # Contributing
Code contributions are always welcomed in lf. Code contributions are always welcome in `lf`.
If you are going to introduce a new feature, it is best to open an issue first for discussion. If your feature can be implemented as a configuration option **please add it to the [wiki](https://github.com/gokcehan/lf/wiki)**. If you are going to introduce a new feature, it is best to open an issue first for discussion. You should also consider the following:
- Whether it can be implemented entirely in user configuration instead
- The complexity added by supporting it
- The number of users interested in it
If your feature can be implemented as a configuration option, **please add it to the [wiki](https://github.com/gokcehan/lf/wiki)**.
For bug fixes, you can simply send a pull request. For bug fixes, you can simply send a pull request.
@@ -12,9 +18,9 @@ In addition to `gofmt` and friends (e.g. [go vet](https://pkg.go.dev/cmd/vet), [
- Global variables are best avoided except when they are not. - Global variables are best avoided except when they are not.
Global variable names are prefixed with `g` as in `gFooBar`. Global variable names are prefixed with `g` as in `gFooBar`.
Exceptions are variables holding values of environmental variables which are prefixed with `env` as in `envFooBar` and regular expressions which are prefixed with `re` as in `reFooBar` when they are global. Exceptions are variables that store values of environment variables, which are prefixed with `env` as in `envFooBar`, and regular expressions, which are prefixed with `re` as in `reFooBar` when they are global.
- Type and function names are small case as in `fooBar` since we don't use exporting. - Type and function names are lowercase as in `fooBar` since we don't use exporting.
- For file name variables, `name`, `fname`, or `filename` should refer to the base name of the file as in `baz.txt`, and `path`, `fpath`, or `filepath` should refer to the full path of the file as in `/foo/bar/baz.txt`. - For filename variables, `name`, `fname`, or `filename` should refer to the base name of the file as in `baz.txt`, and `path`, `fpath`, or `filepath` should refer to the full path of the file as in `/foo/bar/baz.txt`.
- Run `go fmt` to ensure that files are formatted correctly. - Run `go fmt` to ensure that files are formatted correctly.
- Consider using [conventional](https://www.conventionalcommits.org/) commit messages. - Consider using [conventional](https://www.conventionalcommits.org/) commit messages.
@@ -28,7 +34,7 @@ Adding a new option usually requires the following steps:
- Add default option value to `init` function in `opts.go` - Add default option value to `init` function in `opts.go`
- Add option evaluation logic to `setExpr.eval` in `eval.go` - Add option evaluation logic to `setExpr.eval` in `eval.go`
- Implement the option somewhere in the code - Implement the option somewhere in the code
- Add option name and its default value to `Quick Reference` and `Options` sections in `doc.md` - Add option name and its default value to `Quick Reference` and `Settings` sections in `doc.md`
- Run `gen/doc.sh` to update the documentation (optional as it requires `docker`/`podman`, but appreciated) - Run `gen/doc.sh` to update the documentation (optional as it requires `docker`/`podman`, but appreciated)
- Commit your changes and send a pull request - Commit your changes and send a pull request
@@ -65,8 +71,8 @@ Commands should be defined in alphabetical order, but note that commands are fir
## Platform specific code ## Platform specific code
There are two files named `os.go` and `os_windows.go` for Unix and Windows specific code respectively. There are two files named `os.go` and `os_windows.go` for Unix and Windows specific code respectively.
If you add something to either of these files but not the other, you probably break the build for the other platform. If you add something to either of these files but not the other, you will probably break the build for the other platform.
If your addition works the same in both platforms, your addition probably belongs to `main.go` instead. If your addition works the same on both platforms, your addition probably belongs to `main.go` instead.
There are also different variants of the `df` functionality provided by `df_openbsd.go`, `df_statfs.go`, `df_statvfs.go` and `df_windows.go`. There are also different variants of the `df` functionality provided by `df_openbsd.go`, `df_statfs.go`, `df_statvfs.go` and `df_windows.go`.
Where applicable, ensure that any changes you make are reflected across all of these files for consistency. Where applicable, ensure that any changes you make are reflected across all of these files for consistency.