15 Commits
Author SHA1 Message Date
Maksim IvanovandGitHub 7dea9193fb [nacl] Clean up docs, comments, variable names (#1249) 2024-11-08 12:54:11 +01:00
Maksim IvanovandGitHub 4672d52ae5 [hid5021] Exclude 3p code from linting (#1248)
We don't want to run linters or formatters on the third-party code for
the driver.

We still want them on our "glue" code, hence we only exclude the
/src/ subdirectory.
2024-11-08 12:29:50 +01:00
Maksim IvanovandGitHub 7d906fa15e [eslint] Workaround for 9.0.0 update (#1144)
Set the ESLINT_USE_FLAT_CONFIG=false environment variable when running ESLint. This is to workaround the following errors after ESLint got updated to 9.0.0:

  Invalid option '--resolve-plugins-relative-to' - perhaps you meant '--ignore-pattern'?
  You're using eslint.config.js, some command line flags are no longer available. Please see https://eslint.org/docs/latest/use/command-line-interface for details.

Also disable the `no-floating-promise` plugin since it starts
failing with the following error in ESLint 9.0.0:

  TypeError: context.getScope is not a function
2024-04-08 11:16:54 +02:00
Maksim IvanovandGitHub ac1f0e170b Fix permissions for find_files_for_linting.py (#1061)
Add "+x" to this script as it can be executed standalone.
2023-09-22 16:03:47 +09:00
Maksim IvanovandGitHub 58b64c1bf0 [js style] Add eslint-plugin-no-floating-promise (#1042)
Install and enable ESLint's "no-floating-promise" plugin, to prevent
future bugs when an async function is forgotten to be awaited.

Also add a few awaits to silence the warnings, although in these places
"await" wasn't strictly necessary.
2023-09-11 18:13:45 +02:00
Maksim IvanovandGitHub 30f4f5a20a [style] Import find-files-for-linting Python code (#1045)
Change the users of the find-files-for-linting.py Python code
(eslient.py and format-code.py) to import it as a Python module rather
than run as a subprocess.

This should avoid unnecessary overhead and data conversions. The change
renames the file to "find_files_for_linting.py" as dashes in file names
aren't Python-friendly.
2023-09-11 16:51:46 +02:00
Maksim IvanovandGitHub b4b8ef7897 [style] format-code check-only mode (#1043)
Add new parameter "--check-only" to the format-code.py script.

It's primarily intended to be used in automated checks, like CI actions,
for checking for improperly-formatted code.
2023-09-11 14:05:44 +02:00
Maksim IvanovandGitHub 1fee33232f [style] format-code in Python, supports --base (#1024)
Rewrite the format-code Shell script into Python, and make it support
"--base=..." argument.

The refactoring is for better maintainability, and the "--base" arg
allows reformatting the whole repository instead of the current diff.
2023-09-08 13:09:13 +02:00
Maksim IvanovandGitHub 9a8eb87782 [js style] ESLint script accepts base ref and fix (#981)
Rewrite the eslint helper script into Python and add additional
features:
* --base=<gitref> to only consider files in the given git range,
* --fix to automatically apply fixes when possible.

This contributes to the effort tracked by #937.
2023-08-29 15:43:57 +02:00
Maksim IvanovandGitHub 078ad4b760 [scripts] Ignore third-party code from linting (#980)
find-files-for-linting.py ignores third-party code that we don't
maintain manually within this repository.

This contributes to the effort tracked by #937.
2023-08-29 15:25:45 +02:00
Maksim IvanovandGitHub ddca9c6146 [scripts] Pass base gitref to find-files-for-linting (#979)
Let the caller specify whether all files need to be linted, or a
diff to a particular git ref needs to be considered.

This contributes to the effort tracked by #937.
2023-08-29 15:06:55 +02:00
Maksim IvanovandGitHub 846b8598ef [scripts] Rewrite find-files-for-linting in Python (#978)
Reimplement this script in Python, to allow for easier customization for
CI or local execution.

This contributes to the effort tracked by #937.
2023-08-29 14:40:02 +02:00
Maksim IvanovandGitHub e6d0d577ae [js style] Script for running ESLint (#968)
Add helper script that runs the ESLint NPM module on all currently
modified JavaScript files.

This can be used manually by developers, and also follow-ups will
automatically execute it on every CI run, as tracked by #937.
2023-08-28 18:02:38 +02:00
Maksim IvanovandGitHub 1bd0f059cc Refactor logic for finding sources-to-be-linted (#970)
Create a separate helper script for finding manually maintained source
files. Currently it's only used for running clang-format from
format-code.sh, but we're planning to add a similar script for JS
linting.

This contributes to the effort tracked by #937.
2023-08-28 17:40:37 +02:00
Maksim IvanovandGitHub 68567b3335 CI posts coverage percentage on PRs (#578)
Add a script that parses llvm-cov's report table and prints the
resulting line coverage percentage for C/C++ code. Run it in the
Continuous Integration script and post the result as an autogenerated
comment on the Pull Request.
2022-05-19 14:57:06 +02:00