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.

How to define variable reused by different tasks?

See original GitHub issue

For instance, I would like to run lint and black on same multiple folders, instead of specify multiple times.

[tool.taskipy.tasks]
lint = "pylint -r n foo bar"
black = "black foo bar"

=>

[tool.taskipy.tasks]
path = "foo bar"
lint = "pylint -r n path"
black = "black path"

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
northtreecommented, Sep 28, 2021

@illBeRoy Just checkout 1.9.0, LGTM.

BTW, please note that you have typos on previous comment, which should be use_vars = true.

Otherwise will raise Invalid TOML file error.

use_vars = True

      30│     def read(self):  # type: () -> "TOMLDocument"
      31│         try:
      32│             return super(TOMLFile, self).read()
      33│         except (ValueError, TOMLKitError) as e:
    → 34│             raise TOMLError("Invalid TOML file {}: {}".format(self.path.as_posix(), e))
      35│ 
      36│     def __getattr__(self, item):  # type: (str) -> Any
      37│         return getattr(self.__path, item)
      38│ 

At last, just noticed that you did provide excellent README though. Thanks for your awesome work. @Granitosaurus @illBeRoy 🚀

1reaction
Granitosauruscommented, Sep 25, 2021

@illBeRoy great idea! Let me adjust the PR 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reuse the Same Variable with Different Properties - MathWorks
Reuse a variable with different properties when the code generator can determine the properties of each occurrence of the variable.
Read more >
Is there a way to reuse a generic task file but include different ...
I was using the wrong attributes. The following worked for me. Note that I had to use import_task instead of include_tasks.
Read more >
Software Design/Don't reuse a variable - Wikiversity
Reusing a variable for multiple purposes may be seen as a violation of the Single responsibility principle on the level of variables.
Read more >
Roles - Ansible Documentation
Roles . Roles let you automatically load related vars, files, tasks, handlers, and other Ansible artifacts based on a known file structure.
Read more >
Define variables - Azure Pipelines | Microsoft Learn
Variables are name-value pairs defined by you for use in a pipeline. You can use variables as inputs to tasks and in your...
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