<commit_before>//
//  SnapKittenExtension.swift
//  SnapKitten
//
//  Created by <NAME> on 25/2/2017.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import UIKit

public extension UIScrollView{
    func attachContentView(contentView : UIView, scrollOrientation : KittenOrientation){
        self.addSubview(contentView)
        contentView.snp.makeConstraints { (make) in
            if let parent = self.superview{
                switch scrollOrientation{
                case .vertical:
                    make.width.equalTo(parent)
                    make.left.right.equalToSuperview()
                    make.top.bottom.equalToSuperview()
                case .horizontal:
                    make.height.equalTo(parent)
                    make.left.right.equalToSuperview()
                    make.top.bottom.equalToSuperview()
                }
            }else{
                switch scrollOrientation{
                case .vertical:
                    make.width.lessThanOrEqualToSuperview()
                    //                make.width.equalToSuperview()
                    make.left.right.equalToSuperview()
                    make.top.bottom.equalToSuperview()
                case .horizontal:
                    make.height.lessThanOrEqualToSuperview()
                    //                make.height.equalToSuperview()
                    make.top.bottom.equalToSuperview()
                    make.left.right.equalToSuperview()
                }
            }
            
        }
    }
}
<commit_msg>if no parent scrollview, equal to scroll width instead of less<commit_after>//
//  SnapKittenExtension.swift
//  SnapKitten
//
//  Created by <NAME> on 25/2/2017.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import UIKit

public extension UIScrollView{
    func attachContentView(contentView : UIView, scrollOrientation : KittenOrientation){
        self.addSubview(contentView)
        contentView.snp.makeConstraints { (make) in
            if let parent = self.superview{
                switch scrollOrientation{
                case .vertical:
                    make.width.equalTo(parent)
                    make.left.right.equalToSuperview()
                    make.top.bottom.equalToSuperview()
                case .horizontal:
                    make.height.equalTo(parent)
                    make.left.right.equalToSuperview()
                    make.top.bottom.equalToSuperview()
                }
            }else{
                switch scrollOrientation{
                case .vertical:
                    make.width.equalToSuperview()
                    //                make.width.equalToSuperview()
                    make.left.right.equalToSuperview()
                    make.top.bottom.equalToSuperview()
                case .horizontal:
                    make.height.equalToSuperview()
                    //                make.height.equalToSuperview()
                    make.top.bottom.equalToSuperview()
                    make.left.right.equalToSuperview()
                }
            }
            
        }
    }
}

{'fraction_non_alphanumeric': 0.0850176451716394, 'fraction_numerical': 0.007058068655758742, 'mean_word_length': 1.3045084996304508, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6433298', 'n_tokens_mistral': 823, 'n_tokens_neox': 748, 'n_words': 130}