<commit_before>import * as React from 'react'
import { CommitMessage } from './commit-message'
import { ChangedFile } from './changed-file'
import List from '../list'

import Repository from '../../models/repository'
import { WorkingDirectoryStatus } from '../../models/status'

const RowHeight = 20

interface ChangesListProps {
  repository: Repository
  workingDirectory: WorkingDirectoryStatus
  readonly selectedRow: number
  readonly onSelectionChanged: (row: number) => void
  readonly onIncludeChanged: (row: number, include: boolean) => void
  readonly onSelectAll: (selectAll: boolean) => void
  readonly onCreateCommit: (title: string) => void
}

export class ChangesList extends React.Component<ChangesListProps, void> {

  public constructor(props: ChangesListProps) {
    super(props)
  }

  private handleOnChangeEvent(event: React.FormEvent) {
    const include = (event.target as any).checked
    this.props.onSelectAll(include)
  }

  private renderRow(row: number): JSX.Element {
    const file = this.props.workingDirectory.files[row]
    const path = file.path

    return (
      <ChangedFile path={path}
                   status={file.status}
                   include={file.include}
                   key={path}
                   onIncludeChanged={include => this.props.onIncludeChanged(row, include)}/>
    )
  }

  public render() {

    const includeAll = this.props.workingDirectory.includeAll

    return (
      <div id='changes-list'>
        <div id='select-all'>
          <input
            type='checkbox'
            checked={includeAll}
            onChange={event => this.handleOnChangeEvent(event) }
            ref={function(input) {
              if (input != null) {
                input.indeterminate = (includeAll === null)
              }
            }} />
        </div>

        <List id='changes-list-list'
              itemCount={this.props.workingDirectory.files.length}
              itemHeight={RowHeight}
              renderItem={row => this.renderRow(row)}
              selectedRow={this.props.selectedRow}
              onSelectionChanged={row => this.props.onSelectionChanged(row)} />

        <CommitMessage onCreateCommit={title => this.props.onCreateCommit(title)}/>
      </div>
    )
  }
}
<commit_msg>sprinkle some readonly on it<commit_after>import * as React from 'react'
import { CommitMessage } from './commit-message'
import { ChangedFile } from './changed-file'
import List from '../list'

import Repository from '../../models/repository'
import { WorkingDirectoryStatus } from '../../models/status'

const RowHeight = 20

interface ChangesListProps {
  readonly repository: Repository
  readonly workingDirectory: WorkingDirectoryStatus
  readonly selectedRow: number
  readonly onSelectionChanged: (row: number) => void
  readonly onIncludeChanged: (row: number, include: boolean) => void
  readonly onSelectAll: (selectAll: boolean) => void
  readonly onCreateCommit: (title: string) => void
}

export class ChangesList extends React.Component<ChangesListProps, void> {

  public constructor(props: ChangesListProps) {
    super(props)
  }

  private handleOnChangeEvent(event: React.FormEvent) {
    const include = (event.target as any).checked
    this.props.onSelectAll(include)
  }

  private renderRow(row: number): JSX.Element {
    const file = this.props.workingDirectory.files[row]
    const path = file.path

    return (
      <ChangedFile path={path}
                   status={file.status}
                   include={file.include}
                   key={path}
                   onIncludeChanged={include => this.props.onIncludeChanged(row, include)}/>
    )
  }

  public render() {

    const includeAll = this.props.workingDirectory.includeAll

    return (
      <div id='changes-list'>
        <div id='select-all'>
          <input
            type='checkbox'
            checked={includeAll}
            onChange={event => this.handleOnChangeEvent(event) }
            ref={function(input) {
              if (input != null) {
                input.indeterminate = (includeAll === null)
              }
            }} />
        </div>

        <List id='changes-list-list'
              itemCount={this.props.workingDirectory.files.length}
              itemHeight={RowHeight}
              renderItem={row => this.renderRow(row)}
              selectedRow={this.props.selectedRow}
              onSelectionChanged={row => this.props.onSelectionChanged(row)} />

        <CommitMessage onCreateCommit={title => this.props.onCreateCommit(title)}/>
      </div>
    )
  }
}

{'fraction_non_alphanumeric': 0.11628415300546448, 'fraction_numerical': 0.0008743169398907104, 'mean_word_length': 2.572209211553474, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 39, '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': '2207874', 'n_tokens_mistral': 1228, 'n_tokens_neox': 1203, 'n_words': 272}