Perl::...Profile(3pm)

πŸ’… Perl::Critic::UserProfile

okay bestie, so this page is from the Perl::Critic docs (the "User Contributed Perl Documentation" crew, iykyk), and it's all about Perl::Critic::UserProfile β€” literally the contents of your user's profile ✨


✨ NAME ✨

Perl::Critic::UserProfile β€” the contents of the user's profile, which is often .perlcriticrc πŸŽ€


🌸 DESCRIPTION 🌸

Bestie, this is a helper class. That's it. That's the whole vibe. It encapsulates the contents of the user's profile, which is usually stored in a .perlcriticrc file. πŸ¦‹

No user-serviceable parts here. Like, none. Don't go poking around in there, gorgeous, there's nothing for you πŸ’€

🚧 INTERFACE SUPPORT 🚧

Okay so listen β€” this one is considered to be a non-public class. Its interface is subject to change without notice. So if you build your whole personality on it, that's on you, not me πŸ™ˆ The main character energy here is "I might change my mind," and honestly? Respect.


πŸ› οΈ CONSTRUCTOR πŸ› οΈ

new( -profile => $p )

-profile is the path to the user's profile. πŸ’–

If -profile is not defined, then it looks for the profile at ./.perlcriticrc and then $HOME/.perlcriticrc. If neither of those files exists, then the UserProfile is created with default values. slay, defaults are valid ✨

Heads up bestie: this object does not take into account any command-line overrides. Perl::Critic::Config does that. Different class, different job, don't @ me πŸ‘‘

🌈 METHODS 🌈

  • options_processor() β€” Returns the Perl::Critic::OptionsProcessor object for this UserProfile. It's giving "here's your processor, you're welcome" 🫢
  • policy_is_disabled( $policy ) β€” You give it a reference to a Perl::Critic::Policy object or the name of one, and it returns true if the user has disabled that policy in their profile. no cap, that simple πŸ’…
  • policy_is_enabled( $policy ) β€” Same deal: give it a reference to a Perl::Critic::Policy object or the name of one, and it returns true if the user has explicitly enabled that policy in their user profile. Explicitly, bestie. Like, they said it out loud πŸ”₯
  • policy_params( $policy ) β€” Give it a reference to a Perl::Critic::Policy object or the name of one, and it returns a Perl::Critic::PolicyConfig for the user's configuration parameters for that policy. Fancy little config object, iconic πŸ’œ
  • raw_policy_params( $policy ) β€” Same input situation (a reference to a Perl::Critic::Policy object or the name of one), but this one returns a reference to a hash of the user's configuration parameters for that policy. Raw. Unfiltered. Just how I like it πŸ“
  • listed_policies() β€” Returns a list of the names of all the Policies that are mentioned in the profile. The Policy names will be fully qualified (e.g. Perl::Critic::Foo). Full names only, no nicknames, periodt πŸ‘‘
  • source() β€” The place where the profile information came from, if available. Usually the path to a .perlcriticrc. Detective work, but make it cute 🧚

πŸ‘€ SEE ALSO πŸ‘€

  • Perl::Critic::Config
  • Perl::Critic::OptionsProcessor

Go read those too, bestie, they're literally right there 🌸


✍️ AUTHOR ✍️

Jeffrey Ryan Thalhammer <jeff@imaginative-software.com> β€” legend behavior, honestly πŸ‘‘


Copyright (c) 2005-2023 Imaginative Software Systems. πŸ’–

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module. πŸŽ€


okay that's the whole page, mwah πŸ’‹ β€” this was Perl::Critic::UserProfile, from the perl v5.42.0 docs, dated 2024-10-23. Go forth and configure your policies, you gorgeous thing πŸ¦‹βœ¨

πŸ“¦ where this page comes from