<commit_before>// error-pattern:cargo-clippy
#![feature(plugin_registrar)]
#![feature(rustc_private)]
#![allow(unknown_lints)]

extern crate rustc_plugin;
use rustc_plugin::Registry;

extern crate clippy_lints;

pub use clippy_lints::*;

#[plugin_registrar]
pub fn plugin_registrar(reg: &mut Registry) {
    register_plugins(reg);
}

// only exists to let the dogfood integration test works.
// Don't run clippy as an executable directly
#[allow(dead_code, print_stdout)]
fn main() {
    panic!("Please use the cargo-clippy executable");
}<commit_msg>running cargo clippy on a crate that has the clippy plugin enabled errors out due to duplicate lints<commit_after>// error-pattern:cargo-clippy
#![feature(plugin_registrar)]
#![feature(rustc_private)]
#![allow(unknown_lints)]

extern crate rustc_plugin;
use rustc_plugin::Registry;

extern crate clippy_lints;

pub use clippy_lints::*;

#[plugin_registrar]
pub fn plugin_registrar(reg: &mut Registry) {
    if reg.sess.lint_store.borrow().get_lint_groups().iter().any(|&(s, _, _)| s == "clippy") {
        reg.sess.struct_warn("running cargo clippy on a crate that also imports the clippy plugin").emit();
    } else {
        register_plugins(reg);
    }
}

// only exists to let the dogfood integration test works.
// Don't run clippy as an executable directly
#[allow(dead_code, print_stdout)]
fn main() {
    panic!("Please use the cargo-clippy executable");
}
{'fraction_non_alphanumeric': 0.1265017667844523, 'fraction_numerical': 0.0, 'mean_word_length': 5.237885462555066, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1713661', 'n_tokens_mistral': 469, 'n_tokens_neox': 460, 'n_words': 130}