rouge icon indicating copy to clipboard operation
rouge copied to clipboard

Python Syntax highlight breaks in diffs .

Open Sakshi1305 opened this issue 4 years ago • 1 comments

Rouge Python Language

Rouge Gem Version 3.26.0

Code sample A sample of the code that produces the bug.

def get_realtime_status_safety_input_data(self, cpuc_cpu_id):
	"""
	Get data from realtime status safety input field.

	Arguments:
	| Name         | Description    | M/O |
	| cpuc_cpu_id  | Subdevice ID for CPU | M |


	Returns:
	| Description |
	| Dict        |

	Example of returned dictionary:
	{
		"C1": "122222222", ...
		"H2": "0", ...
		"S1": "-1"
	}
	"""
	return self.iot_portal_handler.get_realtime_status_safety_input_data(cpuc_cpu_id)

def get_realtime_status_safety_input_data(self, cpuc_cpu_id):
	"""
	Get data from realtime status safety input field.

	Arguments:
	| Name         | Description    | M/O |
	| cpuc_cpu_id  | Subdevice ID for CPU | M |


	Returns:
	| Description |
	| Dict        |

	Example of returned dictionary:
	{
		"C1": "122222222", ...
		"H2": "0", ...
		"S1": "-1"
	}
	"""
	return self.iot_portal_handler.get_realtime_status_safety_input_data(cpuc_cpu_id)

def get_realtime_status_safety_input_data(self, cpuc_cpu_id):
	"""
	Get data from realtime status safety input field.

	Arguments:
	| Name         | Description    | M/O |
	| cpuc_cpu_id  | Subdevice ID for CPU | M |


	Returns:
	| Description |
	| Dict        |

	Example of returned dictionary:
	{
		"C1": "122222222", ...
		"H2": "0", ...
		"S1": "-1"
	}
	"""
	return self.iot_portal_handler.get_realtime_status_safety_input_data(cpuc_cpu_id)

Additional context Syntax highlight work incorrectly in code review diffs if diff snippet in itself is not syntactically correct. Examples attached.

Screenshot 2021-10-07 at 3 28 52 PM

Code Browser Screenshot attached:

Screenshot 2021-10-07 at 3 39 55 PM

Check differences in both the screenshots, the highlighting does not quite match in the diff, see e.g. the method name and the comment content

Sakshi1305 avatar Oct 08 '21 05:10 Sakshi1305

Is this Gitlab? They do some manual magic to get diff highlighting that we don't do in this project IIRC.

jneen avatar Oct 14 '22 04:10 jneen