5 Commits

Author SHA1 Message Date
Jairo Llopis
19be0a1a74 build(lint): switch over to ruff; add taplo
Ruff is faster, better integrated, easier to configure... Cool!

Taplo also helps with toml maintenance.
2024-01-15 18:26:48 +00:00
Jairo Llopis
67cc4ffde3
feat: nix support
- Provide a dev shell.
- Provide a nix package.
- Provide a nix flake.
- Development environment based on direnv.
- Docs.
- Configure Gitpod to use direnv and nix.
- Configure Cachix out of the box, and document how to use it.
- Add direnv and nix to CI.
- Satisfy some linters that came from Precommix, even when Precommix was later discarded.
- Mark some tests as impure.
- Run only pure tests when building Copier with Nix.
- Add poetry loader to direnv.
- Update contribution guide.
2023-01-18 09:40:08 +00:00
Jairo Llopis
cdb563a96d Add 4-space indentation to .md files
Mkdocs uses `python-markdown`, and [they say](https://python-markdown.github.io/#differences):

> The syntax rules clearly state that when a list item consists of multiple paragraphs, “each subsequent paragraph in a list item must be indented by either 4 spaces or one tab” (emphasis added). However, many implementations do not enforce this rule and allow less than 4 spaces of indentation. The implementers of Python-Markdown consider it a bug to not enforce this rule.

As we were using 2 spaces for markdown files (which looks better in source code), some indented lists were not displaying properly in the docs page.

Thus I change the setting to 4 spaces. Prettier will now enforce them, and mkdocs will display things properly.
2020-08-10 12:59:07 +00:00
Jairo Llopis
f8673465ba
Improve autoformatting
Continues the job started in #104:

- Configure more languages for VSCode to format on save.
- Recommend extensions for VSCode.
- Remove settings from `.prettierrc.yml` that are duplicated in `.editorconfig` (which prettier uses by default).
2020-01-09 13:34:57 +00:00
Jairo Llopis
a549638c3c Add pre-commit
For those new to pre-commit, tl;dr:

- `pre-commit install` will enable a git hook to forbid committing violating code.
- If `git commit` fails, just `git commit -a` again.

This beautiful tool will convert all our source code to a pleasure to be read and written.

Some insights:

- `make install` now enables pre-commit by default.
- Important hooks:
  - Black, the 21th century Python code autoformatter.
  - isort, to sort imports automatically.
  - mypy, which was also being used anyways.
  - Prettier, for non-python files (markdown and YAML in this repo).
  - Flake8 with bugbear, which reveals some extra coding mistakes.
  - Other common checkers & fixers.
- Used as linter in travis.
- Replaced `make flake` for `make lint`.
2019-12-10 11:45:41 +00:00