bytecodealliance / bytecodealliance/rustix

Use a more descriptive comment convention

Abierto
#462 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Rust
Estrellas
2.1k
Forks
296
Merge medio
6 d 22 h
PR fusionados (30 d)
4

Descripción

Currently many functions in rustix are documented with a comment that looks like this:

```rust
/// `openat(dirfd, path, oflags, mode)`—Opens a file.
///
/// POSIX guarantees that `openat` will use the lowest unused file descriptor,
/// however it is not safe in general to rely on this, as file descriptors may
/// be unexpectedly allocated on other threads or in libraries.
///
/// The `Mode` argument is only significant when creating a file.
///
/// # References
/// - [POSIX]
/// - [Linux]
///
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/openat.html
/// [Linux]: https://man7.org/linux/man-pages/man2/open.2.html
```

It starts with a C-ish pseudocode corresponding to what the function does, followed by a short description. My idea was to highlight the correspondence to C, since all the OS documentation is written in terms of C, and rustix isn't currently in a position to have its own complete documentation for everything.

But perhaps it would be better to move the C-ish pseudo-code later, like this, so that the first line is just a description of the thing:

```rust
/// Opens a file.
///
/// POSIX guarantees that `openat` will use the lowest unused file descriptor,
/// however it is not safe in general to rely on this, as file descriptors may
/// be unexpectedly allocated on other threads or in libraries.
///
/// The `Mode` argument is only significant when creating a file.
///
/// # C pseudocode
///
/// ```c
/// openat(dirfd, path, oflags, mode)
/// ```
///
/// # References
/// - [POSIX]
/// - [Linux]
///
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/openat.html
/// [Linux]: https://man7.org/linux/man-pages/man2/open.2.html
```

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Empieza revisando la documentación existente de las funciones de rustix, especialmente los comentarios que usan la convención openat mostrada, y compárala con el formato propuesto en el issue. El trabajo no está listo para comenzar hasta que el proyecto acuerde una convención; se considerará terminado cuando el estilo de documentación acordado se haya aplicado de forma coherente.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
rust
Área
documentation
Tipo de issue
Documentación
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.