pharo-users@lists.pharo.org

Any question about pharo is welcome

View all threads

Is there a pragma to disable a critic for a particular method?

EM
Eric Merritt
Wed, Aug 31, 2022 3:18 PM

Hello Everyone,

While I take the critiques seriously, there are times when I will
intentionally disregard a specific warning. In these cases, in other
languages, I have found it useful to indicate that I am disregarding a
warning by adding a pragma to disable that particular warning. I have been
looking for similar functionality in Pharo. I found an old (circa 2009)
reference to <lint> and <ignoreLintRule> pragmas, but those seem to no
longer work.

Is there currently a way to disable a specific warning in a method?

Thank you,
Eric

Hello Everyone, While I take the critiques seriously, there are times when I will intentionally disregard a specific warning. In these cases, in other languages, I have found it useful to indicate that I am disregarding a warning by adding a pragma to disable that particular warning. I have been looking for similar functionality in Pharo. I found an old (circa 2009) reference to <lint> and <ignoreLintRule> pragmas, but those seem to no longer work. Is there currently a way to disable a specific warning in a method? Thank you, Eric
SJ
Sebastian Jordan Montano
Wed, Aug 31, 2022 7:03 PM

Hello,

I don't know about any pragma, but you can deactivate the lint rule to only one method. You need to click on the "x" that is next to the name of the rule and then select the option that you prefer. This will create a Manifiesto class that contains the information of which rules to ban on to which context.

Cheers,
Sebastian Jordan

De: "Eric Merritt" eric@merritt.tech
À: "pharo-users" pharo-users@lists.pharo.org
Envoyé: Mercredi 31 Août 2022 15:18:07
Objet: [Pharo-users] Is there a pragma to disable a critic for a particular
method?
Hello Everyone,

While I take the critiques seriously, there are times when I will intentionally
disregard a specific warning. In these cases, in other languages, I have found
it useful to indicate that I am disregarding a warning by adding a pragma to
disable that particular warning. I have been looking for similar functionality
in Pharo. I found an old (circa 2009) reference to <lint> and <ignoreLintRule>
pragmas, but those seem to no longer work.

Is there currently a way to disable a specific warning in a method?

Thank you,
Eric

Hello, I don't know about any pragma, but you can deactivate the lint rule to only one method. You need to click on the "x" that is next to the name of the rule and then select the option that you prefer. This will create a Manifiesto class that contains the information of which rules to ban on to which context. Cheers, Sebastian Jordan > De: "Eric Merritt" <eric@merritt.tech> > À: "pharo-users" <pharo-users@lists.pharo.org> > Envoyé: Mercredi 31 Août 2022 15:18:07 > Objet: [Pharo-users] Is there a pragma to disable a critic for a particular > method? > Hello Everyone, > While I take the critiques seriously, there are times when I will intentionally > disregard a specific warning. In these cases, in other languages, I have found > it useful to indicate that I am disregarding a warning by adding a pragma to > disable that particular warning. I have been looking for similar functionality > in Pharo. I found an old (circa 2009) reference to <lint> and <ignoreLintRule> > pragmas, but those seem to no longer work. > Is there currently a way to disable a specific warning in a method? > Thank you, > Eric
EM
Eric Merritt
Thu, Sep 1, 2022 3:22 PM

Thanks, Sebastian,

This worked and solved my problem. For future readers, these changes get
added to a Manifest<Package-Name> class and make their way into the git
repo and the mages that load the baseline in that repo.

It would be nice for a visible pragma to live near the code that triggers
the warning that the pragma is suppressing, but having a way to do this is
much better than not having a way.

Thanks again,
Eric

On Wed, Aug 31, 2022 at 12:04 PM Sebastian Jordan Montano <
sebastian.jordan@inria.fr> wrote:

Hello,

I don't know about any pragma, but you can deactivate the lint rule to
only one method. You need to click on the "x" that is next to the name of
the rule and then select the option that you prefer. This will create a
Manifiesto class that contains the information of which rules to ban on to
which context.

Cheers,
Sebastian Jordan


*De: *"Eric Merritt" eric@merritt.tech
*À: *"pharo-users" pharo-users@lists.pharo.org
*Envoyé: *Mercredi 31 Août 2022 15:18:07
*Objet: *[Pharo-users] Is there a pragma to disable a critic for a
particular method?

Hello Everyone,

While I take the critiques seriously, there are times when I will
intentionally disregard a specific warning. In these cases, in other
languages, I have found it useful to indicate that I am disregarding a
warning by adding a pragma to disable that particular warning. I have been
looking for similar functionality in Pharo. I found an old (circa 2009)
reference to <lint> and <ignoreLintRule> pragmas, but those seem to no
longer work.

Is there currently a way to disable a specific warning in a method?

Thank you,
Eric

Thanks, Sebastian, This worked and solved my problem. For future readers, these changes get added to a Manifest<Package-Name> class and make their way into the git repo and the mages that load the baseline in that repo. It would be nice for a visible pragma to live near the code that triggers the warning that the pragma is suppressing, but having a way to do this is much better than not having a way. Thanks again, Eric On Wed, Aug 31, 2022 at 12:04 PM Sebastian Jordan Montano < sebastian.jordan@inria.fr> wrote: > Hello, > > I don't know about any pragma, but you can deactivate the lint rule to > only one method. You need to click on the "x" that is next to the name of > the rule and then select the option that you prefer. This will create a > Manifiesto class that contains the information of which rules to ban on to > which context. > > > Cheers, > Sebastian Jordan > > ------------------------------ > > *De: *"Eric Merritt" <eric@merritt.tech> > *À: *"pharo-users" <pharo-users@lists.pharo.org> > *Envoyé: *Mercredi 31 Août 2022 15:18:07 > *Objet: *[Pharo-users] Is there a pragma to disable a critic for a > particular method? > > Hello Everyone, > > While I take the critiques seriously, there are times when I will > intentionally disregard a specific warning. In these cases, in other > languages, I have found it useful to indicate that I am disregarding a > warning by adding a pragma to disable that particular warning. I have been > looking for similar functionality in Pharo. I found an old (circa 2009) > reference to <lint> and <ignoreLintRule> pragmas, but those seem to no > longer work. > > Is there currently a way to disable a specific warning in a method? > > Thank you, > Eric > >
MD
Marcus Denker
Fri, Sep 2, 2022 8:42 AM

On 1 Sep 2022, at 17:22, Eric Merritt eric@merritt.tech wrote:

Thanks, Sebastian,

This worked and solved my problem. For future readers, these changes get added to a Manifest<Package-Name> class and make their way into the git repo and the mages that load the baseline in that repo.

It would be nice for a visible pragma to live near the code that triggers the warning that the pragma is suppressing, but having a way to do this is much better than not having a way.

Yes, the storage of code meta data is something that we should re-think. The current way is kind of the most simple thing that worked, but it has many downsides.

And it is another example of  the interesting thing that, as soon we think of code (and thus the model of the language itself), we stop thinking in terms of Objects.

Everything has to be a Class or a Method. For sure we can do better.

Marcus
> On 1 Sep 2022, at 17:22, Eric Merritt <eric@merritt.tech> wrote: > > Thanks, Sebastian, > > This worked and solved my problem. For future readers, these changes get added to a Manifest<Package-Name> class and make their way into the git repo and the mages that load the baseline in that repo. > > It would be nice for a visible pragma to live near the code that triggers the warning that the pragma is suppressing, but having a way to do this is much better than not having a way. Yes, the storage of code meta data is something that we should re-think. The current way is kind of the most simple thing that worked, but it has many downsides. And it is another example of the interesting thing that, as soon we think of code (and thus the model of the language itself), we stop thinking in terms of Objects. Everything has to be a Class or a Method. For sure we can do better. Marcus