Skip to content

Commit

Permalink
feat(readme): how to update dialyzer ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
ProducerMatt committed Aug 29, 2024
1 parent 8577942 commit c95e314
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ It is a sequel to the [Stampy](https://github.com/StampyAI/stampy) Discord bot.

## Use

[Download the Nix package manager](https://nixos.org/download/). This handles the development environment for Stampede. It runs on Linux, Mac, Windows, and Docker. It won't disrupt your system setup -- though once you start using it, it may be hard to stop. :smile:
[Download the Nix package manager](https://github.com/DeterminateSystems/nix-installer). This handles the development environment for Stampede. It runs on Linux, Mac, Windows, and Docker. It won't disrupt your system setup -- though once you start using it, it may be hard to stop. :smile:

Once Nix is ready, just cd to the dev directory and run `nix develop .#` to load the dev environment, then `mix deps.get` to get the dependencies. Some commands:
- `iex -S mix` to run Stampede in the `dev` environment, also providing the famous Elixir interactive shell.
Expand All @@ -18,5 +18,29 @@ Once Nix is ready, just cd to the dev directory and run `nix develop .#` to load

Configurations for servers are written in YAML and left in `./Sites/`. In different environments (such as `test` and `dev`) it will read configs from `./Sites_{environment-name}`. Check the service documentation for what options your service has available.

- `./lib/services` defines services where chat requests are incoming.
- `./lib/plugins` defines plugins which suggest potential responses, along with a confidence estimate for how relevant the response would be. Plugins which use resources or take time will offer a *callback* instead, which will only be called if no other plugins have higher confidence.
- `./lib/services` defines services where chat requests are incoming. They follow the standard set in `./lib/service.ex`
- `./lib/plugins` defines plugins which suggest potential responses, along with a confidence estimate for how relevant the response would be. Plugins which use resources or take time will offer a *callback* instead, which will only be called if no other plugins have higher confidence. They follow the standard set in `./lib/plugin.ex`

### Updating `.dialyzer_ignore.exs`

Often when changing code, you will end up with superfluous Dialyzer warnings. You can suppress them by updating the Dialyzer ignore file. To start:

```bash
rm ./.dialyzer_ignore.exs
mix dialyzer --format ignore_file_strict &> .dialyzer_ignore.exs.incoming
```

Remove all but the Elixir tuples, which will look like this:

```elixir
{"lib/stampede.ex", "Function server_id/0 has no local return."},
```

Put a `[` at the start of the file and a `]` at the end, so they become one list of tuples. Now you can rename the file to its true name and format it:

```bash
mv ./.dialyzer_ignore.exs{.incoming,}
mix format ./.dialyzer_ignore.exs
```

Now Dialyzer should not raise any more warnings.

0 comments on commit c95e314

Please sign in to comment.