question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature: Deprecate old pending functionality in favor of new todo feature

See original GitHub issue

This 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 old pending and new todo
  • 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 to hidden 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 option

      ember-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:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
rwjbluecommented, Oct 7, 2020

Chatted with @scalvert and I think we are going to “rebrand” from pending to todo. This seems to put folks in a better frame of mind and coincides nicely with QUnit’s own QUnit.todo.

0reactions
chrisrngcommented, Jan 15, 2021

This is awesome! Does this also exist somehow in ESLint land?

@Alonski Yes! https://github.com/scalvert/eslint-formatter-todo

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deprecated Features in the Base App - Business Central
Deprecated Features in 2020 release wave 1​​ The following feature was marked as obsolete:pending in 2020 release wave 1.
Read more >
2088074 - All About the Home Page To-Do List
By default the To-Do list shows items that are currently pending, plus items completed within the last 2 months, plus items that will...
Read more >
To-Do List - GitLab Documentation
Your To-Do List is a chronological list of items waiting for your input. The items are known as to-do items. You can use...
Read more >
Behavior Change Log
Deprecated Features. The following Snowflake features and operating systems/programming languages are deprecated or pending deprecation: ...
Read more >
Pending pacts | Pact Docs
Without the feature enabled, any failing pact (eg. ones with new features) will cause the provider's build to break, blocking the provider from ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found