(self)
| 104 | original_lines: List[str] = field(default_factory=list) |
| 105 | |
| 106 | def is_dirty(self) -> bool: |
| 107 | current_content_lines = [] |
| 108 | for opt in self.global_options: |
| 109 | current_content_lines.append(str(opt)) |
| 110 | if self.global_options and ( |
| 111 | not current_content_lines or current_content_lines[-1].strip() != "" |
| 112 | ): |
| 113 | current_content_lines.append("") |
| 114 | for host in self.hosts: |
| 115 | current_content_lines.append(f"Host {' '.join(host.patterns)}") |
| 116 | for opt in host.options: |
| 117 | current_content_lines.append(str(opt)) |
| 118 | current_content_lines.append("") |
| 119 | while current_content_lines and current_content_lines[-1] == "": |
| 120 | current_content_lines.pop() |
| 121 | for inc in self.include_directives: |
| 122 | current_content_lines.append(f"Include {inc}") |
| 123 | |
| 124 | original_clean_lines = [line.rstrip("\n") for line in self.original_lines] |
| 125 | |
| 126 | while original_clean_lines and original_clean_lines[-1] == "": |
| 127 | original_clean_lines.pop() |
| 128 | |
| 129 | return current_content_lines != original_clean_lines |
| 130 | |
| 131 | def get_host(self, alias: str) -> Optional[SSHHost]: |
| 132 | for h in self.hosts: |
no outgoing calls
no test coverage detected