Feature: Deprecate old pending functionality in favor of new todo feature
See original GitHub issueThis library already has a feature that allows for pending
violations to be identified, by module, and converts them to warnings when considering whether to error or not.
This spec proposes a more robust set of functionality when dealing with pending items, starting with renaming pending to todo.
From the Motivation section in that spec:
Linting is a fundamental tool to help ensure the quality of a codebase. Ensuring there are as few linting errors as possible (ideally 0), is a useful measure of a baseline of code hygiene.
It’s common to leverage linting not just for syntax adherence, but also to direct developers to employ standardized patterns. As such, it’s a fairly routine activity to introduce new lint rules into a codebase. This introduction, while necessary, can cause unintended friction, such as
- new lint errors being introduced where they previously didn’t exist
- causing unintended delays to shipping new fixes and features
- an “all or nothing” approach, where new rules require fixing before rollout.
Having the ability to identify violations as
todo
would allow for this incremental roll out, while providing tools that will allow maintainers to view the full list of todo violations. Todo violations can include a createdDate, allowing thresholds of time to trigger due date violations. This can assist in prioritizing lint rule violation fixes, and can ensure the todo list doesn’t remain stagnant.
The rest of that spec details the intended behavior. This issue will detail the changes needed in ember-template-lint
in order to implement this behavior as first-party functionality.
CHANGES:
- Detect existing
pending
behavior, and ensure correct branching to support both oldpending
and newtodo
- Rename
@ember-template-lint/pending-utils
to@ember-template-lint/todo-utils
- Leverage
@ember-template-lint/pending-utils
to parse and generate.lint-todo
dir - Update docs for the new feature
- Ensure adequate test coverage of expected workflows
- Set
--print-pending
option tohidden
in help
WORKFLOWS:
-
when upgrading to new ember-template-lint version that includes todo:
# behaves as normal - no todo functionality ember-template-lint
-
when linting failure exists (severity 2) that has a current todo item, switch linting failure’s severity to not trigger a failure
-
todo items should not be included in default output (#1248)
-
todo item counts should be included in counts output
✖ 8 problems (5 errors, 3 warnings, 2 todo)
if no problems, no output (as normal) if no problems but
--include-todo
, output todo count✓ 0 problems (0 errors, 0 warnings, 2 todo)
-
todo items should be included with output if running with the
--include-todo
optionember-template-lint . --include-todo
-
-
when opting in to todo functionality:
# add new todo items for new errors # remove todo items for errors that are no longer present # existing errors that have todo items should not be modified ember-template-lint . --update-todo # or ember-template-lint lib/my-inrepo-addon --update-todo
-
when you have fixed a todo item, to update todo list:
# only removes todo items ember-template-lint . --fix
-
when you have deleted a linted file (foo.hbs), todo files associated with that file become orphaned. If you run linting for a specific file, no output will occur:
ember-template-lint app/templates/foo.hbs
-
when you have deleted a linted file (foo.hbs), todo files associated with that file become orphaned. You need to run
--update-todo
to cleanup todo files for that file:ember-template-lint . --update-todo
-
when old pending system (
config.pending
) and new todo system (.lint-todo
) co-exist, error -
when
--update-todo
ran and old pending system exists (config.pending
), migrate old to new
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
Chatted with @scalvert and I think we are going to “rebrand” from
pending
totodo
. This seems to put folks in a better frame of mind and coincides nicely with QUnit’s ownQUnit.todo
.@Alonski Yes! https://github.com/scalvert/eslint-formatter-todo