netbox-community / devicetype-library

A collection of community-sourced DeviceType definitions for import to NetBox
Creative Commons Zero v1.0 Universal
923 stars 925 forks source link

Update the test cases to prevent non-ascii characters in yaml files #2461

Closed ravench closed 3 days ago

ravench commented 1 week ago

NetBox appears to not be able to handle non-ascii characters. This causes issues when importing devices or modules that contain non-ascii characters. Those are usually dashes (long, short, ect) and symbols like (r) or (tm).

In a shell, the files at issue can be found using grep:

LC_ALL=C  grep -l "[\x80-\xFF]" ./**/*.yaml 

There should be a test for this. There seems to be no applicable test in pre-commit-hooks and no flag for yamlfmt or yamllint, so handling this in a own hook or in pytest seems to be necessary.

Unfortunately, I don't understand pytest well enough to write my own tests, therefore this is an issue and not a pull request.