formatters
ruff_sync.formatters ¶
Output formatters for CLI results.
ResultFormatter ¶
Bases: Protocol
Protocol for output formatters.
Source code in src/ruff_sync/formatters.py
TextFormatter ¶
Standard text output formatter.
Delegates diagnostic messages (info, warning, error, debug) to the project logger to ensure they benefit from standard logging configuration (colors, streams). Primary command feedback (note, success) is printed to stdout.
Source code in src/ruff_sync/formatters.py
GithubFormatter ¶
GitHub Actions output formatter.
Emits ::error:: and ::warning:: workflow commands for inline annotations.
Source code in src/ruff_sync/formatters.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | |
note ¶
info ¶
success ¶
error ¶
Print an error message as a GitHub Action error annotation.
Source code in src/ruff_sync/formatters.py
warning ¶
Print a warning message as a GitHub Action warning annotation.
Source code in src/ruff_sync/formatters.py
debug ¶
Print a debug message as a GitHub Action debug annotation.
Source code in src/ruff_sync/formatters.py
JsonFormatter ¶
JSON output formatter.
Source code in src/ruff_sync/formatters.py
note ¶
info ¶
Print an info message as JSON.
success ¶
error ¶
Print an error message as JSON.
Source code in src/ruff_sync/formatters.py
warning ¶
Print a warning message as JSON.
Source code in src/ruff_sync/formatters.py
debug ¶
Print a debug message as JSON.
diff ¶
get_formatter ¶
Return the corresponding formatter for the given format.