src/nitpick/plugins/ini.py
def enforce_rules(self) -> Iterator[Fuss]:
        """Enforce rules on missing sections and missing key/value pairs in an INI file."""
        try:
            yield from self._read_file()
        except Error:
            return

        yield from self.enforce_missing_sections()

        csv_sections = {v.split(".")[0] for v in self.comma_separated_values}
        missing_csv = csv_sections.difference(self.current_sections)
        if missing_csv:
            yield self.reporter.make_fuss(
                Violations.INVALID_COMMA_SEPARATED_VALUES_SECTION, ", ".join(sorted(missing_csv))
            )
            # Don't continue if the comma-separated values are invalid
            return

        for section in self.expected_sections.intersection(self.current_sections) - self.missing_sections:
            yield from self.enforce_section(section)
Enforce rules on missing sections and missing key/value pairs in an INI file.
Enforce rules on missing sections and missing key/value pairs in an INI file.
Enforce rules on missing sections and missing key / value pairs in an INI file .
def enforce_rules(self) -> Iterator[Fuss]:
        try:
            yield from self._read_file()
        except Error:
            return
        yield from self.enforce_missing_sections()
        csv_sections = {v.split(".")[0] for v in self.comma_separated_values}
        missing_csv = csv_sections.difference(self.current_sections)
        if missing_csv:
            yield self.reporter.make_fuss(
                Violations.INVALID_COMMA_SEPARATED_VALUES_SECTION, ", ".join(sorted(missing_csv))
            )
            return
        for section in self.expected_sections.intersection(self.current_sections) - self.missing_sections:
            yield from self.enforce_section(section)
def enforce_rules ( self ) -> Iterator [ Fuss ] : try : yield from self . _read_file ( ) except Error : return yield from self . enforce_missing_sections ( ) csv_sections = { v . split ( "." ) [ 0 ] for v in self . comma_separated_values } missing_csv = csv_sections . difference ( self . current_sections ) if missing_csv : yield self . reporter . make_fuss ( Violations . INVALID_COMMA_SEPARATED_VALUES_SECTION , ", " . join ( sorted ( missing_csv ) ) ) return for section in self . expected_sections . intersection ( self . current_sections ) - self . missing_sections : yield from self . enforce_section ( section )
Enforce rules on missing sections and missing key/value pairs in an INI file.
Enforce rules on missing sections and missing key / value pairs in an INI file .
"""Enforce rules on missing sections and missing key/value pairs in an INI file.""" # Don't continue if the comma-separated values are invalid
self