async_job_lints 0.2.2
async_job_lints: ^0.2.2 copied to clipboard
Analyzer plugin for async_job: a wait in cleanup, a late release, a catch that takes a cancellation, an async callback of fakeAsync, a wait past the context.
0.2.2 #
plugin_api.dartexportsisSoloLanes,controllerAround,declaresLane,callsOnandreadsState, for the rules of a plugin on top about the lanes;solo_lints0.3.0 requires them.declaresLanetells whether alane(...)onthisorsuperdeclares a lane whereSoloLaneslets it, right in a constructor body, andqueueLaneOftakes a lane field from the same place: a field assigned fromsuper.lane(...)is the controller's own now, as one fromlane(...)is.
0.2.1 #
- The rules know
solo2.0:SoloController, the base ofSoloand of the newSoloLanes, andSoloLane, a lane ofSoloLanes.outcome_after_awaittakesjobof a lane as it takesjobof aSolo, as a job that does not run until it is queued. plugin_api.dartexportsisSoloController,isSoloLane,queueLaneOfandQueueLane, andqueueCallOfandqueuedBodyOf, which a rule on top asks to agree withbare_awaiton the call a wait is for and on the body queued on the controller.queueLaneOftells whether a wait in a job body is for the lane the job runs in, for another lane or not known, andisSoloMemberwithSolotakes the member of the same name ofSoloLanetoo, so the rules of a plugin on top that nameenqueue,enqueueJob,job,collectandaccumulateof aSolosee those of a lane.registerAsyncJobLintstakesownLaneReportedElsewhere: with it,bare_awaitanddiscarded_outcomeleave a wait for the own lane to the plugin on top. Without it, as fromsolo_lints0.2.0, which knows no lanes, they report that wait as any other.ownQueueCallkeeps its signature and its answers for aSolo, and findscloseandcancelAllof aSoloStreammixed into aSolo.bare_awaitanddiscarded_outcomeleave a wait for the own lane to the plugin on top only from a body queued in that lane, where the plugin reports it, anddiscarded_outcomeonly an awaited one: adonedropped withoutawaitwaits for nothing. A lane field is the controller's own only when every write to it in its class islane(...)in a constructor body: a lane the controller takes, from a constructor parameter, an initializer list or a setter, may be another controller's, though a constructor declares it too. For the own queue of aSoloboth rules answer as in 0.2.0.
0.2.0 #
- Two new warnings on the result of a job, on as soon as the plugin is named:
discarded_outcomereports an outcome ofdonethat is awaited and dropped, where the failure reaches nobody, andoutcome_after_awaitreports the first read of a job's result that comes after a wait, where the failure has gone to the zone before the read.dart analyzefails on code it passed before, so the release is a minor one. - The README sends the reader for the table of the context to the reference
page of
async_job, where the table moved from its README.
0.1.1 #
- The message of
bare_awaitand its section of the README no longer setctx.joinbesidectx.abandonableandctx.pauseas a wait that a cancellation cuts short, with onlyctx.uncancellablefor steps that must run to the end.joinwaits for the whole call and throws only after it; the message and the README now say what each of the four is for.
0.1.0 #
- The first release. The five rules for code on async_job,
ctx_in_cleanup,release_on_the_call,catch_without_check,sync_fake_asyncandbare_await, and the quick fixes ofrelease_on_the_callandcatch_without_checkcome from solo_lints 0.1.4 and behave as they did there, with two changes:bare_awaitreports a wait for a job of the own queue of a solo controller, which solo_lints leaves toawait_own_queue, and the ids of the quick fixes begin withasync_job_lints.fix.instead ofsolo_lints.fix.. package:async_job_lints/plugin_api.dartregisters the rules in another plugin, for analyzer plugins built on top of this one.- The package has an example: a recorder on async_job with three mistakes, the lines the plugin reports and the same job fixed.