<commit_before>//
//  OperatorUsageWhitespaceRule.swift
//  SwiftLint
//
//  Created by <NAME> on 12/13/16.
//  Copyright © 2016 Realm. All rights reserved.
//

import Foundation
import SourceKittenFramework

public struct OperatorUsageWhitespaceRule: OptInRule, CorrectableRule, ConfigurationProviderRule {

    public var configuration = SeverityConfiguration(.warning)

    public init() {}

    public static let description = RuleDescription(
        identifier: "operator_usage_whitespace",
        name: "Operator Usage Whitespace",
        description: "Operators should be surrounded by a single whitespace " +
                     "when they are being used.",
        nonTriggeringExamples: [
            "let foo = 1 + 2\n",
            "let foo = 1 > 2\n",
            "let foo = !false\n",
            "let foo: Int?\n",
            "let foo: Array<String>\n",
            "let foo: [String]\n",
            "let foo = 1 + \n  2\n",
            "let range = 1...3\n",
            "let range = 1 ... 3\n",
            "let range = 1..<3\n",
            "#if swift(>=3.0)\n",
            "array.removeAtIndex(-200)\n",
            "let name = \"image-1\"\n",
            "button.setImage(#imageLiteral(resourceName: \"image-1\"), for: .normal)\n",
            "let doubleValue = -9e-11\n",
            "let red  = CGFloat((rgbaValue >> 24) & 0xff) / 255.0"
        ],
        triggeringExamples: [
            "let foo = 1↓+2\n",
            "let foo = 1↓   + 2\n",
            "let foo = 1↓   +    2\n",
            "let foo = 1↓ +    2\n",
            "let foo↓=1↓+2\n",<commit_msg>Fix tests<commit_after>//
//  OperatorUsageWhitespaceRule.swift
//  SwiftLint
//
//  Created by <NAME> on 12/13/16.
//  Copyright © 2016 Realm. All rights reserved.
//

import Foundation
import SourceKittenFramework

public struct OperatorUsageWhitespaceRule: OptInRule, CorrectableRule, ConfigurationProviderRule {

    public var configuration = SeverityConfiguration(.warning)

    public init() {}

    public static let description = RuleDescription(
        identifier: "operator_usage_whitespace",
        name: "Operator Usage Whitespace",
        description: "Operators should be surrounded by a single whitespace " +
                     "when they are being used.",
        nonTriggeringExamples: [
            "let foo = 1 + 2\n",
            "let foo = 1 > 2\n",
            "let foo = !false\n",
            "let foo: Int?\n",
            "let foo: Array<String>\n",
            "let foo: [String]\n",
            "let foo = 1 + \n  2\n",
            "let range = 1...3\n",
            "let range = 1 ... 3\n",
            "let range = 1..<3\n",
            "#if swift(>=3.0)\n",
            "array.removeAtIndex(-200)\n",
            "let name = \"image-1\"\n",
            "button.setImage(#imageLiteral(resourceName: \"image-1\"), for: .normal)\n",
            "let doubleValue = -9e-11\n"
        ],
        triggeringExamples: [
            "let foo = 1↓+2\n",
            "let foo = 1↓   + 2\n",
            "let foo = 1↓   +    2\n",
            "let foo = 1↓ +    2\n",
            "let foo↓=1↓+2\n",
{'fraction_non_alphanumeric': 0.14528543938422064, 'fraction_numerical': 0.029185375240538807, 'mean_word_length': 1.7098175499565595, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '6614338', 'n_tokens_mistral': 1032, 'n_tokens_neox': 959, 'n_words': 252}