Skip to content

Put the condition before the command

Rule ste-procedural.condition-after-command in the STE Procedural Writing category.

Field Value
Kind pattern
Severity warning
Scope body-sentence
Profile strict enforced
Profile normal advisory
Profile relaxed advisory

The condition follows the command (“<match>”). Put the condition first.

Move the condition clause to the front and follow it with a comma.

Restart the worker if the queue depth is above one thousand.

Rewrite:

If the queue depth is above one thousand, restart the worker.
Clear the cache when the import completes.

Rewrite:

When the import completes, clear the cache.
Drain the queue before the worker shuts down.

Rewrite:

The worker drains the queue before it shuts down.
For headless servers, configure the permissions required by the workload before it starts.

Rewrite:

Before the workload starts, configure the permissions it requires on headless servers.
Reconcile the ledger when the import completes.

Rewrite:

When the import completes, reconcile the ledger.
  • quotation
  • code-span

ASD-STE100