From 6b3f6616e888b3856233feda17dd700a999ab303 Mon Sep 17 00:00:00 2001 From: Valentin Perrelle <valentin.perrelle@cea.fr> Date: Thu, 3 Feb 2022 19:14:38 +0100 Subject: [PATCH] [ivette] lint: conform to camelcase rule --- .../api/generated/plugins/eva/values/index.ts | 34 +++++++++---------- ivette/src/frama-c/plugins/eva/cells.ts | 16 ++++----- ivette/src/frama-c/plugins/eva/valueinfos.tsx | 2 +- ivette/src/frama-c/plugins/eva/valuetable.tsx | 18 +++++----- src/plugins/value/api/values_request.ml | 10 +++--- 5 files changed, 40 insertions(+), 40 deletions(-) diff --git a/ivette/src/frama-c/api/generated/plugins/eva/values/index.ts b/ivette/src/frama-c/api/generated/plugins/eva/values/index.ts index dde6739568c..38080fe7582 100644 --- a/ivette/src/frama-c/api/generated/plugins/eva/values/index.ts +++ b/ivette/src/frama-c/api/generated/plugins/eva/values/index.ts @@ -149,7 +149,7 @@ export interface evaluation { /** Alarms raised by the evaluation */ alarms: [ "True" | "False" | "Unknown", string ][]; /** List of variables pointed by the value */ - pointed_vars: [ string, marker ][]; + pointedVars: [ string, marker ][]; } /** Loose decoder for `evaluation` */ @@ -167,12 +167,12 @@ export const jEvaluation: Json.Loose<evaluation> = ),'Union expected'), Json.jFail(Json.jString,'String expected'), ))), - pointed_vars: Json.jList( - Json.jTry( - Json.jPair( - Json.jFail(Json.jString,'String expected'), - jMarkerSafe, - ))), + pointedVars: Json.jList( + Json.jTry( + Json.jPair( + Json.jFail(Json.jString,'String expected'), + jMarkerSafe, + ))), }); /** Safe decoder for `evaluation` */ @@ -183,33 +183,33 @@ export const jEvaluationSafe: Json.Safe<evaluation> = export const byEvaluation: Compare.Order<evaluation> = Compare.byFields <{ value: string, alarms: [ "True" | "False" | "Unknown", string ][], - pointed_vars: [ string, marker ][] }>({ + pointedVars: [ string, marker ][] }>({ value: Compare.string, alarms: Compare.array(Compare.pair(Compare.structural,Compare.string,)), - pointed_vars: Compare.array(Compare.pair(Compare.string,byMarker,)), + pointedVars: Compare.array(Compare.pair(Compare.string,byMarker,)), }); const getValues_internal: Server.GetRequest< { callstack?: callstack, target: marker }, - { v_else?: evaluation, v_then?: evaluation, v_after?: evaluation, - v_before?: evaluation } + { vElse?: evaluation, vThen?: evaluation, vAfter?: evaluation, + vBefore?: evaluation } > = { kind: Server.RqKind.GET, name: 'plugins.eva.values.getValues', input: Json.jObject({ callstack: jCallstack, target: jMarkerSafe,}), output: Json.jObject({ - v_else: jEvaluation, - v_then: jEvaluation, - v_after: jEvaluation, - v_before: jEvaluation, + vElse: jEvaluation, + vThen: jEvaluation, + vAfter: jEvaluation, + vBefore: jEvaluation, }), signals: [], }; /** Abstract values for the given marker */ export const getValues: Server.GetRequest< { callstack?: callstack, target: marker }, - { v_else?: evaluation, v_then?: evaluation, v_after?: evaluation, - v_before?: evaluation } + { vElse?: evaluation, vThen?: evaluation, vAfter?: evaluation, + vBefore?: evaluation } >= getValues_internal; /* ------------------------------------- */ diff --git a/ivette/src/frama-c/plugins/eva/cells.ts b/ivette/src/frama-c/plugins/eva/cells.ts index d972e64e0e6..3e9a9f1d724 100644 --- a/ivette/src/frama-c/plugins/eva/cells.ts +++ b/ivette/src/frama-c/plugins/eva/cells.ts @@ -175,10 +175,10 @@ export class ValueCache { .send(Values.getValues, { target: marker, callstack }) .then((r) => { newValue.errors = undefined; - if (r.vBefore) newValue.vBefore = r.v_before; - newValue.v_after = r.v_after; - newValue.v_then = r.v_then; - newValue.v_else = r.v_else; + if (r.vBefore) newValue.vBefore = r.vBefore; + newValue.vAfter = r.vAfter; + newValue.vThen = r.vThen; + newValue.vElse = r.vElse; if (this.updateLayout(marker, fct, callstack, newValue)) this.state.forceLayout(); else @@ -200,10 +200,10 @@ export class ValueCache { v: EvaValues, ): boolean { // measuring cell - let s = sizeof(v.v_before.value); - s = addS(s, v.v_after?.value); - s = addS(s, v.v_then?.value); - s = addS(s, v.v_else?.value); + let s = sizeof(v.vBefore.value); + s = addS(s, v.vAfter?.value); + s = addS(s, v.vThen?.value); + s = addS(s, v.vElse?.value); v.size = s; // max cell size const { smax } = this; diff --git a/ivette/src/frama-c/plugins/eva/valueinfos.tsx b/ivette/src/frama-c/plugins/eva/valueinfos.tsx index 817e64e5f75..fa0b9036db0 100644 --- a/ivette/src/frama-c/plugins/eva/valueinfos.tsx +++ b/ivette/src/frama-c/plugins/eva/valueinfos.tsx @@ -73,7 +73,7 @@ export function AlarmsInfos(props: ModelProp) { if (probe) { const callstack = model.getCallstack(); const domain = model.values.getValues(probe, callstack); - const alarms = domain?.v_before.alarms ?? []; + const alarms = domain?.vBefore.alarms ?? []; if (alarms.length > 0) { const renderAlarm = ([status, alarm]: EvaAlarm) => { const className = `eva-alarm-info eva-alarm-${status}`; diff --git a/ivette/src/frama-c/plugins/eva/valuetable.tsx b/ivette/src/frama-c/plugins/eva/valuetable.tsx index 93fc09aa6cf..4dba874b851 100644 --- a/ivette/src/frama-c/plugins/eva/valuetable.tsx +++ b/ivette/src/frama-c/plugins/eva/valuetable.tsx @@ -54,16 +54,16 @@ import './style.css'; // -------------------------------------------------------------------------- function computeValueDiffs(v: EvaValues, vstate: EvalStmt | EvalCond) { - let here = v.v_before; + let here = v.vBefore; let diff: undefined | Evaluation; let diff2: undefined | Evaluation; - function setValue(e?: Evaluation) { if (e) { here = e; diff = v.v_before; } } + function setValue(e?: Evaluation) { if (e) { here = e; diff = v.vBefore; } } switch (vstate) { - case 'Before': diff = v.v_after; break; - case 'After': setValue(v.v_after); break; - case 'Then': setValue(v.v_then); break; - case 'Else': setValue(v.v_else); break; - case 'Cond': diff = v.v_then; diff2 = v.v_else; break; + case 'Before': diff = v.vAfter; break; + case 'After': setValue(v.vAfter); break; + case 'Then': setValue(v.vThen); break; + case 'Else': setValue(v.vElse); break; + case 'Cond': diff = v.vThen; diff2 = v.vElse; break; } const vdiffs = { text: here.value, diff: diff?.value, diff2: diff2?.value }; return { value: here, vdiffs }; @@ -126,8 +126,8 @@ function TableCell(props: TableCellProps) { if (value.alarms.find(([st, _]) => st === 'False')) status = 'False'; else status = 'Unknown'; } - if (value.pointed_vars.length > 0) - pointedVars = value.pointed_vars; + if (value.pointedVars.length > 0) + pointedVars = value.pointedVars; const alarmClass = `eva-cell-alarms eva-alarm-${status}`; const title = 'At least one alarm is raised in one callstack'; contents = ( diff --git a/src/plugins/value/api/values_request.ml b/src/plugins/value/api/values_request.ml index 83526a8cb55..7c6c686a5bd 100644 --- a/src/plugins/value/api/values_request.ml +++ b/src/plugins/value/api/values_request.ml @@ -582,7 +582,7 @@ module JEvaluation = struct let alarms = Record.field record ~name:"alarms" ~descr:(Markdown.plain "Alarms raised by the evaluation") (module Jlist (Jpair (Jtruth) (Jstring))) - let pointed_vars = Record.field record ~name:"pointed_vars" + let pointed_vars = Record.field record ~name:"pointedVars" ~descr:(Markdown.plain "List of variables pointed by the value") (module Jlist (Jpair (Jstring) (Jmarker))) @@ -609,16 +609,16 @@ let () = and get_cs = Request.param_opt getValues ~name:"callstack" ~descr:(Md.plain "Callstack to collect (defaults to none)") (module Jcallstack) - and set_before = Request.result_opt getValues ~name:"v_before" + and set_before = Request.result_opt getValues ~name:"vBefore" ~descr:(Md.plain "Domain values before execution") (module JEvaluation) - and set_after = Request.result_opt getValues ~name:"v_after" + and set_after = Request.result_opt getValues ~name:"vAfter" ~descr:(Md.plain "Domain values after execution") (module JEvaluation) - and set_then = Request.result_opt getValues ~name:"v_then" + and set_then = Request.result_opt getValues ~name:"vThen" ~descr:(Md.plain "Domain values for true condition") (module JEvaluation) - and set_else = Request.result_opt getValues ~name:"v_else" + and set_else = Request.result_opt getValues ~name:"vElse" ~descr:(Md.plain "Domain values for false condition") (module JEvaluation) in -- GitLab