Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Commit

Permalink
merge: PR #168 from feature/50-solidity-linter-rules/114-ordering-rul…
Browse files Browse the repository at this point in the history
…e-staging
  • Loading branch information
0xmemorygrinder committed Oct 9, 2023
2 parents 4f5394d + 43a8fcd commit cd432d0
Show file tree
Hide file tree
Showing 8 changed files with 537 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::fs;

use glob::glob;

#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct SolidFile {
pub data: ast_extractor::File,
pub path: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@ use std::collections::HashMap;

#[macro_use]
pub(crate) mod import_on_top;
pub(crate) mod ordering;

// List all rules
use crate::rules::order::import_on_top::ImportOnTop;
use crate::rules::order::ordering::Ordering;
use crate::rules::RuleBuilder;

pub fn create_default_rules() -> Vec<RuleEntry> {
vec![ImportOnTop::create_default()]
vec![ImportOnTop::create_default(), Ordering::create_default()]
}

pub fn create_rules() -> RulesMap {
let mut rules: HashMap<String, RuleBuilder> = HashMap::new();

rules.insert(import_on_top::RULE_ID.to_string(), ImportOnTop::create);
rules.insert(ordering::RULE_ID.to_string(), Ordering::create);

rules
}
Loading

0 comments on commit cd432d0

Please sign in to comment.