Skip to content

Propagate attribute-like macros in define_rule_mapping#2583

Merged
charliermarsh merged 1 commit intomainfrom
charlie/cfg
Feb 5, 2023
Merged

Propagate attribute-like macros in define_rule_mapping#2583
charliermarsh merged 1 commit intomainfrom
charlie/cfg

Conversation

@charliermarsh
Copy link
Member

This enables us to feature-flag rules, like:

ruff_macros::define_rule_mapping!(
    #[cfg(feature = "logical_lines")]
    E111 => rules::pycodestyle::rules::IndentationWithInvalidMultiple,
    ...
)

pl_codes.insert(code_str.to_string());
pl_codes.insert(code_str, attr.clone());
}
all_codes.insert(code_str);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT, all_codes is unused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant