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

docs: Document testing branches #13

Merged
merged 1 commit into from
Aug 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
This project uses [insta][insta] for snapshot testing. Review the instructions
for using insta and installing the `cargo insta` executable.

## Language Support
## Development

### Language Support

While the library does support providing your own language definitions, the
"out-of-the-box" language definitions are defined in
Expand All @@ -19,7 +21,7 @@ to help identify languages, etc. Pretty much anything involving language
detection or the returned language data comes from this file (but there are
a few exceptions).

### The `languages.yaml` file
#### The `languages.yaml` file

A language looks roughly like this:

Expand Down Expand Up @@ -61,7 +63,7 @@ All entries in this file should be alphabetized. There is a
by the CI. But surely you'll run it locally so that the CI passes the first
time, right? ;)

### File Attributes
#### File Attributes

This tool also tries to detect if a file is documentation, generated, or vendored.
These can be a bit too complex to be managed with a data file, so you'll need to
Expand All @@ -71,6 +73,12 @@ Check `documentation.rs`, `generated.rs`, and `vendored.rs` in [`gengo/src`][lib
to update detection for these. For performance reasons, checks that *don't* require
reading contents should always be done before checks that *do* read contents.

## Testing

Because this project analyzes git revisions, some of the tests are run
commits in this project that are unreachable from `main`. Make sure to
fetch branches that are prefixed with `test/` from this repository.

[check-languages-script]: ./scripts/check-languages-file.rb
[insta]: https://crates.io/crates/insta
[languages-file]: ./gengo/languages.yaml
Expand Down