Add crate-ci/typos for typo correction

There are lots of places in the code where typos might occur. Those even
squeeze into the openapi and as such into the generated code. On the
Rust side we already use `typos` to check that so we need to also invoke
it when we generate openapi specs themselves.

Change-Id: I9d27391492f9eb10a6b65d4c4589b12db2610813
This commit is contained in:
Artem Goncharov
2024-08-01 10:33:38 +02:00
parent 9bf61cfd49
commit ceec1ebf1b
2 changed files with 21 additions and 0 deletions

View File

@@ -19,3 +19,21 @@
loop: "{{ install_additional_projects }}"
loop_control:
loop_var: zj_dep
- name: Download crate-ci/typos
ansible.builtin.get_url:
url: "https://github.com/crate-ci/typos/releases/download/v1.23.6/typos-v1.23.6-x86_64-unknown-linux-musl.tar.gz"
dest: "/tmp/typos.tar.gz"
- name: Create bin folder
ansible.builtin.file:
path: "{{ ansible_user_dir }}/bin"
state: "directory"
mode: "0755"
- name: Unpack typos
ansible.builtin.unarchive:
src: "/tmp/typos.tar.gz"
dest: "{{ ansible_user_dir }}/bin"
creates: "{{ ansible_user_dir }}/bin/typos"
remote_src: true

View File

@@ -20,3 +20,6 @@
{%- if codegenerator_api_ref is defined and codegenerator_api_ref is mapping %}
--api-ref-src {{ ansible_user_dir }}/{{ zuul.projects[codegenerator_api_ref.project].src_dir }}/{{ codegenerator_api_ref.path | default("/api-ref/build/html/index.html") }}
{% endif %}
- name: "Fix typos"
ansible.builtin.command: "{{ ansible_user_dir }}/bin/typos -vw {{ ansible_user_dir }}/{{ codegenerator_work_dir }}/openapi_specs"