You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and had to set database to be lazy since this initializes the app lazy: true
Also had to mimic parameters.neon which is the unversioned file I use to parametrize my ~3-line app (env file). (My bootstrap file has $configurator->addConfig(__DIR__ . '/config/parameters.neon');)
I guess I could rewrite the app bootstrapping from scratch to adapt this but I just followed nette docs and it's not worth it since the project is "just a small app".
Still, I'd rather had a binary I could pass few params to but it is what it is.
Too much work to ignore/learn one macro it seems but I guess I don't have a big picture. Hope it helps.
Feel free to suggest a better way. The point is that ignoring goes against the intent of the linter. Linter has to validate the use, content etc of custom macros too.
Sure, I know it needs the container to get the whole context. But I had to rebootstrap the whole app in CI as shown above even though I wanted to just catch latte deprecations before breaking production. The vendor/bin/latte-lint worked great out of the box, except it gave me 2 more errors on unknown webpack macro.
This vendor/bin/latte-lint --ignore-tags webpack,potato src looked much simpler for my use case and those ignored tags would have been my responsibility now.
Activity
simPod commentedon Apr 20, 2022
Or just some option like
./latte-lint --ignore-tags webpack,potato srcLinter: add class Latte\Tools\Linter [Closes #286]
dg commentedon Apr 20, 2022
It works this way:
mabar commentedon Apr 20, 2022
@dg It took some trial and error to make it work with Nette application, but here we go:
simPod commentedon Apr 20, 2022
So we cannot use the binary straight away, right?
dg commentedon Apr 20, 2022
I'll modify it to set
StringLoaderdirectly in thescanDirectory().Otherwise, Linter automatically adds macros for forms and applications when available.
Linter: add class Latte\Tools\Linter [Closes #286]
dg commentedon Apr 20, 2022
If you don't use custom macros, you can.
simPod commentedon Apr 20, 2022
This is what the issue is about
For anyone trying to set this up in CI:
I took the snippet above, changed it to this:
and had to set database to be lazy since this initializes the app
lazy: trueAlso had to mimic
parameters.neonwhich is the unversioned file I use to parametrize my ~3-line app (env file). (My bootstrap file has$configurator->addConfig(__DIR__ . '/config/parameters.neon');)This is how it looks in GA:
I guess I could rewrite the app bootstrapping from scratch to adapt this but I just followed nette docs and it's not worth it since the project is "just a small app".
Still, I'd rather had a binary I could pass few params to but it is what it is.
Too much work to ignore/learn one macro it seems but I guess I don't have a big picture. Hope it helps.
dg commentedon Apr 20, 2022
Feel free to suggest a better way. The point is that ignoring goes against the intent of the linter. Linter has to validate the use, content etc of custom macros too.
simPod commentedon Apr 20, 2022
Sure, I know it needs the container to get the whole context. But I had to rebootstrap the whole app in CI as shown above even though I wanted to just catch latte deprecations before breaking production. The
vendor/bin/latte-lintworked great out of the box, except it gave me 2 more errors on unknownwebpackmacro.This
vendor/bin/latte-lint --ignore-tags webpack,potato srclooked much simpler for my use case and those ignored tags would have been my responsibility now.Linter: add class Latte\Tools\Linter [Closes #286]