Pope Pius XII
Divino Afflante Spiritu §34
Divino Afflante Spiritu: On Promoting Biblical Studies
34 Thus can he the better understand who was the inspired author, and what he wishes to express by his writings. There is no one indeed but knows that the supreme rule of interpretation is to discover and define what the writer intended to express, as St. Athanasius excellently observes: "Here, as indeed is expedient in all other passages of Sacred Scripture, it should be noted, on what occasion the Apostle spoke; we should carefully and faithfully observe to whom and why he wrote, lest, being ignorant of these points, or confounding one with another, we miss the real meaning of the author."
Source: Divino Afflante Spiritu (Vatican.va)