Skip to content

[service] V2 migration linter - checks to add #11393

@SSE4

Description

@SSE4

now we have V2 migration linter (#11147), it's time to think about useful checks to add.
we definetely don't want to add too broad checks like replace "import conans" via "import conan", as it basically means "rewrite the whole recipe".
I personally guess we should start from small things, which are easy to check and fix.
a good candidates where should we start could be:

  1. V2 migration guide - it lists some useful things, but definetely, it still lacks a lot of things.
  2. learn from our own expirience. e.g. fmt migration highlights some major things to be done

from what I can currently recommend, we may try to implement the following pieces first:

  1. easy imports (existing in both v1 and v2), like from conan.errors import ConanInvalidConfiguration, from conan import ConanFile, with higher granularty
  2. replace run_environment=True via env="conanrun" (VirtualRunEnv generator)
  3. use self.info in package_id method instead of just self
  4. use conan.tools instead of conan.tools, with higher granularity - code changes are mostly to add first self argument, but they are in different namespaces now
  5. replace build_requires via tool_requires
  6. enforce explicit test_type

anything else?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedNeed some help to be finish

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions