Skip to content

Commit 74a0c4b

Browse files
authored
Add Insufficient_permissions case as a reason to skip a target (#304)
Clients consuming `semgrep` output should be upgraded to support this. Used by semgrep/semgrep-proprietary#2506 - [x] I ran `make setup && make` to update the generated code after editing a `.atd` file (TODO: have a CI check) - [x] I made sure we're still backward compatible with old versions of the CLI. For example, the Semgrep backend need to still be able to *consume* data generated by Semgrep 1.17.0. See https://atd.readthedocs.io/en/latest/atdgen-tutorial.html#smooth-protocol-upgrades
1 parent 00eec91 commit 74a0c4b

7 files changed

+49
-11
lines changed

semgrep_output_v1.atd

+12-6
Original file line numberDiff line numberDiff line change
@@ -609,9 +609,13 @@ type error_span = {
609609
(*****************************************************************************)
610610

611611
(* A reason for skipping a target file or a pair (target, rule).
612-
* Note that this type is also used in Report.ml hence the need
613-
* for deriving show here.
614-
*)
612+
Note that this type is also used in Report.ml hence the need
613+
for deriving show here.
614+
615+
For consistency, please make sure all the JSON constructors use the
616+
same case rules (lowercase, underscores). This is hard to fix later!
617+
Please review your code carefully before committing to interface changes.
618+
*)
615619
type skip_reason <ocaml attr="deriving show"> = [
616620
(* Originally returned by the Python CLI *)
617621
| Always_skipped <json name="always_skipped">
@@ -630,11 +634,13 @@ type skip_reason <ocaml attr="deriving show"> = [
630634
| Irrelevant_rule <json name="irrelevant_rule">
631635
| Too_many_matches <json name="too_many_matches">
632636
(* New in osemgrep *)
633-
| Gitignore_patterns_match
637+
| Gitignore_patterns_match (* TODO: use JSON lowercase for consistency *)
634638
(* since 1.40.0 (dotfiles were always ignored, but not shown in the skip report *)
635-
| Dotfile
639+
| Dotfile (* TODO: use JSON lowercase for consistency *)
636640
(* since 1.44.0 *)
637-
| Nonexistent_file
641+
| Nonexistent_file (* TODO: use JSON lowercase for consistency *)
642+
(* since 1.94.0 *)
643+
| Insufficient_permissions <json name="insufficient_permissions">
638644
] <ocaml repr="classic">
639645

640646
(* coupling: ugly: with yield_json_objects() in target_manager.py *)

semgrep_output_v1.jsonschema

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1.proto

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1.py

+20-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1.ts

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1_j.ml

+8-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1_j.mli

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)