Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
SSE4 opened this issue Jun 27, 2022 · 4 comments
Closed

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

SSE4 opened this issue Jun 27, 2022 · 4 comments
Labels
enhancement New feature or request help wanted Need some help to be finish

Comments

@SSE4
Copy link
Contributor

SSE4 commented Jun 27, 2022

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?

@uilianries uilianries added the enhancement New feature or request label Jun 27, 2022
@uilianries
Copy link
Member

I would say conan-io/hooks#387 is related. Adding set_property would be great too.

@jgsogo jgsogo added the help wanted Need some help to be finish label Jun 28, 2022
@jgsogo jgsogo pinned this issue Jun 28, 2022
@jgsogo
Copy link
Contributor

jgsogo commented Jun 28, 2022

Whatever can be easily fixed by any contributor seeing the error, it is more than welcome. Anyone should feel free to suggest the changes to the linter, the PR will validate how many recipes are broken given the new check and the merge might be blocked if there are too many errors.

@Croydon
Copy link
Contributor

Croydon commented May 25, 2024

I guess this issue can be closed.

The most basic check is no imports from conans.* and then let's see if 2.0 CI succeeds.

Otherwise this is more an issue for the hooks repository, right?

@valgur
Copy link
Contributor

valgur commented Nov 4, 2024

@uilianries Can probably close this one as well.

@AbrilRBS AbrilRBS closed this as completed Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Need some help to be finish
Projects
None yet
Development

No branches or pull requests

6 participants